On Wed, Sep 16, 2009 at 7:51 PM, Mark <[email protected]> wrote:
> Is there a way for me to store the
> session value into my database field 'user' when the user creates the
> new entry (and prevent the user from manipulating the value)?

You can add stuff to the incoming "params" hash using merge.

@user = User.find( session[:user_id] )

params[:blog].merge( :user => @user ) if @user

Blog.create!( params[:blog] )


-- 
Greg Donald
http://destiney.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
-~----------~----~----~----~------~----~------~--~---

Reply via email to