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”) %>

<%= submit_tag(‘Verstuur’) %>
<% end %>

Anyone?

On 26 Oct 2007, at 14:26, Martijn wrote:

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

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 ) %>

On Oct 26, 3:43 pm, Frederick C. [email protected]