Ruby on Rails Sunday, March 1, 2020

How do i add user_id to a new record without placing it in a form as a hidden field? I tried adding in the controller's create action just before `if @post.save?` but that didn't cause new records created to have a value for user_id Maybe it was because I'm using a nested form and this record is a child record

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/3903125c-1f66-4ed3-89dd-b73620d797f2%40googlegroups.com.

No comments:

Post a Comment