ClevelandOnRails / rubyonrailsbook

Learn Ruby on Rails. Use coupon code GITHUB2013 on LeanPub for a discount!
https://leanpub.com/Ruby-on-Rails-The-little-Gem-that-Could
Other
9 stars 2 forks source link

articles#show action, now with more pixie dust. #63

Open jrgifford opened 10 years ago

jrgifford commented 10 years ago

Update this to reflect what the codebase looks like here

Open up the `app/controllers/articles_controller.rb` file in your editor.

![](images/010.png)

The part we are interested in is the `def show` action.

    # GET /articles/1
    # GET /articles/1.json
    def show
      respond_to do |format|
        format.html # show.html.erb
        format.json { render json: @article }
      end
    end
jrgifford commented 10 years ago

solution: do pseudo code for the explanation, saying "this is whats going on behind the scenes". Or better yet, use ri to inject itself into it to find out what the heck it's actually doing, and show them how to use ri and rdoc to find things.

jrgifford commented 10 years ago

and here's what I mean by that. http://www.jstorimer.com/blogs/workingwithcode/7766081-5-reasons-you-should-use-ri-to-read-ruby-documentation