remote_form_for

Dear all,

I'm having problems with a hidden form field in remote_form_for.

When I remove the comment on the second line of the code (see below),
I get the error:

undefined method `merge' for 1:Fixnum

1 is the user.id, so that's correct. But what does the error mean?

The code:

<% remote_form_for([@project, @message]) do |f| %>
  <%#= f.hidden_field('recipient_id', user.id ) %>
   <%= f.text_area('text', :size =>"10x4") %><br />
  <%= submit_tag('Verstuur') %>
<% end %>

Anyone?

It means it was expecting a hash of options (for which it would be ok to call merge on).
Do you actually want hidden_field_tag ?

Fred

I agree. You should do:

<%= f.hidden_field('recipient_id', :value => user.id ) %>