Robby Russell wrote: > In your routes, you can do something like: > > map.resources :books, :has_many => [ ::reviews ] > > Then where you want to show the review form, you could do something > like... > > <% form_for :book, :url => book_reviews_path( @book ) do |f| %> > > When the form submits, you should see the book_id in the params hash, > which you can use to connect the dots. >
I have this in my routes file map.resources :books, :has_many => [ :reviews ] But I wasn't able to get the form_for to work for me. Do I have to include an action to get this to work properly or do I need to revise the above syntax to get that to work properly. I currently have an error on this line <%= f.text_field :title %> with the error message of" undefined method `title'". Thanks. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---

