On 12 Jul 2008, at 21:08, Justin To wrote:
>
> 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 %>
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
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---