Hi guys, I've tried both of those options and can't get it to work, I think it's the way I am trying to retrieve the values in the partial.
In the development.log I have this error: undefined method `title' for #<HashWithIndifferentAccess:0x1f7f930> In my controller I have this: render :partial => 'advert', :object => @advert And in my partial I have tried both if these: <%= advert.title %> <%= @advert.title %> No luck. Any suggestions? Phil On Mar 1, 8:59 pm, phil7085 <p....@btopenworld.com> wrote: > Thanks, > > I will give this a try, although as a newbie this talk > of :locals, :object, etc has slightly gone over my head. I'm sure i'll > get it. > > Phil > > On Mar 1, 8:37 pm, Phlip <phlip2...@gmail.com> wrote: > > > phil7085 wrote: > > > How would I then need to tell rails to use the @advert object because > > > that's the part that I have been having trouble with? > > > Formerly, it was this: > > > def preview > > @advert = Advert.new(params[:advert]) > > render :partial => 'advert', :locals =>{ :@advert => @advert } > > end > > > I prefer that style because it makes @advert, inside the partial, safe to > > test > > for nil. However, on our latest new project (Rails 2.2.2) either we did > > something else wrong, or the :@ stopped working, and we had to use this: > > > render :partial => 'advert', :locals =>{ :advert => @advert } > > > Does anyone know if the :@ trick should still work? > > > -- > > Phlip --~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---