small medium large xlarge

28555da_pragsmall
21 Feb 2009, 13:34
David Wilbur (49 posts)

chapter 12 version b1_10, seems rather incomplete in comparison to the prior chapters, and would be a rather abrupt change for the reader.

has_many, and has_many :through and some of the potential associated tasks related to that could easily take up a chapter. it should at least point the reader at “Using Models as Join Tables” on 376 when it brings up “has_many :orders, :through => :line_items”.

in prior chapters if you updated some portion of code there was a link, the various versions of who_bought after 187 have no link, so the reader has no idea as to what should be the final state of who_bought at the end of the chapter. for example should the reader assume that who_bought should look like:

def who_bought @product = Product.find(params[:id]) @orders = @product.orders respond_to do |format| format.html format.xml { render :layout => false , :xml => @product.to_xml(:include => :orders) } format.atom { render :layout => false } format.json { render :layout => false , :json => @product.to_json(:include => :orders) } end end

the link on 191 to get the shown who_bought.atom.builder causes safari to do this:

Safari can’t open the page. Safari can’t open the page “feed://media.pragprog.com/titles/rails3/code/depot_r/app/views/info/who_bought.atom.builder”. The error was: “The feed could not be loaded because the content is not in a known feed format.” (PubSub:2) Please choose Report Bugs to Apple from the Safari menu, note the error number, and describe what you did before you saw this message.

firefox for that link asks, what app should i use for this. the prior link for who_bought.xml.builder worked as expected.

the json version doesn’t need a who_bought.json.builder but there is no mention as to why.

You must be logged in to comment