Forum: Ruby on Rails Submit_tag question

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Marcus B. (Guest)
on 2006-05-23 02:34
(Received via mailing list)
Can I pass additional parameters when using a submit_tag?

Is this legal?

     <%= submit_tag 'Save' , { :editfacility => params["editfacility"] }
%>


When I do this, the "editfacility" parameter is always lost.  I have a
feeling I'm missing something basic...

Thanks,
Marcus
Alex W. (Guest)
on 2006-05-23 02:56
Marcus B. wrote:
> Can I pass additional parameters when using a submit_tag?
>
> Is this legal?
>
>      <%= submit_tag 'Save' , { :editfacility => params["editfacility"] }
> %>
>
>
> When I do this, the "editfacility" parameter is always lost.  I have a
> feeling I'm missing something basic...
>
> Thanks,
> Marcus

You want a hidden_field, submit button only submits the form.
This topic is locked and can not be replied to.