Ok, thanks a lot !
But, these objects are not already saved in the database, so I can not
save the ids !
I have to check a lot of things before doing that.........a solution
could be to use transactions.
How can I rollback after have saved objects ?
One more time, thank you Frederick !
Frederick Cheung wrote:
> On Jun 2, 6:46�pm, Chdem Chdem <li...@ruby-forum.com> wrote:
>
>> I only have the NoMethodError when accessing to the session key/value in
>> an another function than the one where affectation was made, but in the
>> same controler. Is it an envidence ?
>
> If the problem only appears when accessing stuff put in the session by
> a previous request and happens in development mode it's probably
> related to code reloading. In between requests reloads your classes so
> on subsequent requests your session contains objects of class that
> rails has thrown out.
>
> In general you should avoid sticking large or complicated things in
> the session - for example you could store an array of ids of the
> active record objects. You should also know that memory store isn't a
> good choice for a production app - separate passenger or mongrel
> instances won't share sessions
>
> Fred
--
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 rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
No comments:
Post a Comment