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?
--~--~---------~--~----~------------~-------~--~----~
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
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---
On 26 Oct 2007, at 14:26, Martijn wrote:> > 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? >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 --~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
I agree. You should do:
<%= f.hidden_field(''recipient_id'', :value => user.id )
%>
On Oct 26, 3:43 pm, Frederick Cheung
<frederick.che...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:> On 26 Oct 2007, at 14:26, Martijn wrote:
>
>
>
> > 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?
>
> 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
--~--~---------~--~----~------------~-------~--~----~
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
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---