On 09 Jul 2010, at 17:02, Pål Bergström wrote:
Why are you overcomplicating things so much?
Good question. :-) It's so much easier when you have a "programmers"
brain. I don't.
Thanks for your suggestion. But how do I get the value of a cookie in
the model?
... or if you just want to make it a field value:
# In controller
def create
MyModel.create(params[:my_model].merge(:some_field =>
cookies[:some_cookie]))
end
No need to juggle around and just mass-assign using a hash, like
demonstrated above.
Best regards
Peter De Berdt
--
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-t...@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.