# Remote\_form\_for

**URL:** <https://www.ruby-forum.com/t/remote-form-for/118392>\
**Category:** Rails\
**Created:** [October 26, 2007, 3:27pm UTC](https://www.ruby-forum.com/t/remote-form-for/118392 "2007-10-26T15:27:02Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![martijn](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/dbc845/32.png) [@martijn](https://www.ruby-forum.com/u/martijn)\
**Post date:** [October 26, 2007, 3:27pm UTC](https://www.ruby-forum.com/t/remote-form-for/118392/1 "2007-10-26T15:27:02Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![martijn](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/dbc845/32.png) [@martijn](https://www.ruby-forum.com/u/martijn)\
**Post date:** [October 26, 2007, 3:45pm UTC](https://www.ruby-forum.com/t/remote-form-for/118392/2 "2007-10-26T15:45:11Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![martijn](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/dbc845/32.png) [@martijn](https://www.ruby-forum.com/u/martijn)\
**Post date:** [October 26, 2007, 4:58pm UTC](https://www.ruby-forum.com/t/remote-form-for/118392/3 "2007-10-26T16:58:22Z")

</div>

I agree. You should do:

\<%= f.hidden\_field(‘recipient\_id’, :value =\> user.id ) %\>

On Oct 26, 3:43 pm, Frederick C. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)
