diff --git a/sites/en/intro-to-rails/datatypes.step b/sites/en/intro-to-rails/datatypes.step index 366888356..edd9760c8 100644 --- a/sites/en/intro-to-rails/datatypes.step +++ b/sites/en/intro-to-rails/datatypes.step @@ -48,12 +48,12 @@ tip "If you are using Rails 3.x, you can skip this step." end step "Edit `_form.html.erb` to add an input field for the dog's age" do message "add to `/app/views/dogs/_form.html.erb`:" - message "```erb -
+ message '```erb +
<%= f.label :age %>
<%= f.number_field :age %>
-```" +```' explanation do message " Now, when you go to edit one of your dogs, you'll be able to set their age! diff --git a/sites/en/intro-to-rails/dog_scaffold.step b/sites/en/intro-to-rails/dog_scaffold.step index 53f0027a0..9e35a8120 100644 --- a/sites/en/intro-to-rails/dog_scaffold.step +++ b/sites/en/intro-to-rails/dog_scaffold.step @@ -34,7 +34,7 @@ Some important ones include: `dogs name:string` means our table is called `dogs` and has a value called `name` for each row * models: `app/models/dog.rb` -* views: `app/models/views/dogs` +* views: `app/views/dogs` * controllers: `app/controllers/dogs_controller.rb` The basic CRUD features for `dogs` are already in the model, view, and controller files. @@ -106,7 +106,7 @@ tip "If you killed the server with `Control-c` in the last step, you may need to end step "Edit the view that displays your `dog` list" do - message "Edit the file `app/views/dogs/index.html.erb`; put `` tags on either side of the code `<%= dog.name %>`. + message "Edit the file `app/views/dogs/index.html.erb`; add some text, such as \"This dog's name is\", before the code `<%= dog.name %>` (but after the `` HTML tag). " explanation do message "Rails views use a combination of HTML and ERB (which is a kind of Ruby code)." @@ -114,7 +114,7 @@ tip "If you killed the server with `Control-c` in the last step, you may need to Anything within a `<% %>` is interpreted as Ruby code, but not printed out. For example, this page uses a *loop* to print out the same information for each `dog` record: the loop begins with `<% for @dogs.each %>` and ends with `<% end %>`. -All of the code within the loop gets executed once for each record stored in the `@dogs` array variable. Since you added the `` tags within the loop, the boldness is applied to all the dogs in your database. (Add some more dogs to your database if you have less than two dogs right now, so you can see the loop in action.) +All of the code within the loop gets executed once for each record stored in the `@dogs` array variable. Since you added the extra text within the loop, it will show up as many times as you have dogs in your database. (Add some more dogs to your database if you have less than two dogs right now, so you can see the loop in action.) " end end diff --git a/sites/en/intro-to-rails/pictures.step b/sites/en/intro-to-rails/pictures.step index 6336e0021..e73d30c86 100644 --- a/sites/en/intro-to-rails/pictures.step +++ b/sites/en/intro-to-rails/pictures.step @@ -12,9 +12,9 @@ gem 'carrierwave'" end end step do - console 'heroku addons:add cloudinary' + console 'heroku addons:create cloudinary' tip do - message "Heroku might ask you to enter a credit card at this step; Cloudinary's starter plan is free and you _will not_ be charged." + message "Heroku might ask you to enter a credit card at this step; Cloudinary's starter plan is free and you _will not_ be charged. However, if you'd like to skip this step, please feel free to do so." end message "Edit your `Gemfile` and add the line:" @@ -22,7 +22,7 @@ gem 'carrierwave'" gem 'cloudinary'" explanation do message "Since Heroku doesn't let us store images on our filesystem, we will need to use cloud storage. Cloudinary will give us a place to store our images where they'll be accessible via Heroku." - message "`heroku addons:add cloudinary` activates Cloudinary via your Heroku account." + message "`heroku addons:create cloudinary` activates Cloudinary via your Heroku account." end end step do @@ -58,18 +58,20 @@ gem 'cloudinary'" # end ```' explanation do - message "If we were storing the pictures on our own filesystem, rather than in the cloud, we would want to keep these lines, and our pictures would be stored in the `uploads/` directory; however, since we're going to use Cloudinary instead, we'll need to comment out the lines about filesystem storage." + message "If we were storing the pictures on our own filesystem, rather than in the cloud, we would want to keep these lines, and our pictures would be stored in the `uploads/` directory; however, since we're going to use Cloudinary instead, we'll need to comment out the lines about filesystem storage." end - + message 'uncomment the line' message "```ruby - version :thumb + version :thumb do + process :resize_to_fit => [50, 50] + end ``` " explanation do message "This line means the uploader will automatically create resized thumbnail versions of your pictures -- so that your users won't have to worry about what size their pictures are when they upload them." end end - + step do message 'open `app/models/dog.rb`' message 'add the code:' @@ -117,7 +119,7 @@ require(:dog).permit(:name, :age, :picture) ```' explanation do - message "This line adds an image tag to your HTML, which looks for the URL to the thumbnail picture of your dog and uses that as the image source. + message "This line adds an image tag to your HTML, which looks for the URL to the thumbnail picture of your dog and uses that as the image source. Adding `unless dog.picture_url(http://github.com/:thumb).blank?` will keep your app from trying to display broken images for any dogs that haven't had pictures uploaded for them." end @@ -161,5 +163,5 @@ step do Try exchanging Heroku URLs with other students in your group and uploading dog pictures to each others' apps. " end -end +end next_step 'sorting'