# Forms

**URL:** <https://www.ruby-forum.com/t/forms/142893>\
**Category:** Rails\
**Created:** [July 12, 2008, 10:08pm UTC](https://www.ruby-forum.com/t/forms/142893 "2008-07-12T22:08:25Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jturney](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e99b99/32.png) [@jturney](https://www.ruby-forum.com/u/jturney)\
**Post date:** [July 12, 2008, 10:08pm UTC](https://www.ruby-forum.com/t/forms/142893/1 "2008-07-12T22:08:25Z")

</div>

Hi,

I have a form with two inputs, user and password. How do I access these  
two fields after a user fills them out and presses on the submit button?

I want to pass these two values to an action, add\_user. How do I do  
this?

I have \<% form\_remote\_tag :url =\> { :action =\> :add\_user } do %\>  
\<%= submit\_tag “Add user” %\>  
\<% end %\>

:add\_user(a, b) doesn’t seem to work

in the controller:  
def add\_user(a, b)

Thanks

---

<div class="post-metadata">

**Author:** ![jturney](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e99b99/32.png) [@jturney](https://www.ruby-forum.com/u/jturney)\
**Post date:** [July 12, 2008, 10:11pm UTC](https://www.ruby-forum.com/t/forms/142893/2 "2008-07-12T22:11:54Z")

</div>

On 12 Jul 2008, at 21:08, Justin To wrote:

> I have \<% form\_remote\_tag :url =\> { :action =\> :add\_user } do %\>  
> \<%= submit\_tag “Add user” %\>  
> \<% end %\>

A form submits its input elements. A form’s input elements are the one  
it contains.

> :add\_user(a, b) doesn’t seem to work
> 
> in the controller:  
> def add\_user(a, b)

controller actions never take any arguments. The params hash contains  
the passed parameters. I reckon you’d safe yourself some time by  
sitting down with a decent book/tutorial.

Fred
