I am trying to insert a user id from devise into another table which collects contact details and company name and so on and i am using -
<%= f.hidden_field :user_id, current_user.id %>
and all i seem to get back is an error on the page when i load it up -
undefined method `merge' for 1:Fixnum
Extracted source (around line #46):
am i missing something, do I have to put anything in the controller so i can access the current_user information?
Any help with this would be appreciated.
Robbie
You can use it like
<%= f.hidden_field :user_id, :value => current_user.id %>
or
<%= hidden_field_tag "user_id",nil,:value => current_user.id %>
Try it..
You can also do something like this.
<%= hidden_field_tag('some_object[user_id]', current_user.id)%>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With