I tried manually defining @album like so id=1 @review=Review.new(params[:review]) @review.album=Album.find(id) @review.save
Because of this, I don't think it's that @album was not defined. Also as I brought up before, and I think this is key in showing their is something fundamentally wrong in my set up, the association doesn't even work at the command line. Ex: a=Album.find(1) r=Review.new r.album=a This yields an error that says "NoMethodError: undefined method 'album=' for #<Review:......" Any insight? On Fri, Sep 26, 2008 at 12:06 AM, Frederick Cheung < [EMAIL PROTECTED]> wrote: > > > > On Sep 26, 5:53 am, Jon <[EMAIL PROTECTED]> wrote: > > class ReviewsController < ApplicationController > > > > def create > > @review=Review.new(params[:review]) > > @[EMAIL PROTECTED] > > @review.save > > redirect_to '/inventory' > > end > > The problem you have is that @album is nil, because you haven't set it > to anything. It may have been set when you rendered the form, but that > was a different instance of the controller (quite possibly in a > different process or even server). You need to have whatever parameter > in the form you need to be able to retrieve that album, (eg a > hidden_field) > > Fred > > > > end > > > > i'm not sure that @[EMAIL PROTECTED] is the correct syntax, but even > > at the command line when I instantiate an object of type Review and do > > Review.album.title="GoldDigger", it says that album is an undefined > > method. The only thing I can think of is that I am missing something > > when I set up the associations. > > > --~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-talk@googlegroups.com 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 -~----------~----~----~----~------~----~------~--~---