Using submit_tag to pass parameters

No Gravatar

If you want to pass a parameter through a form, you don’t pass it through submit_tag, you pass it in start_form_tag. For example, I want to pass the value of id:
<%= start_form_tag :action => ‘create’, :id => @thisparticularid %>

This is much more secure than using a hidden field, for obvious reasons!

Tags: ,

Leave a Reply

You must be logged in to post a comment.


nogeek.org is Digg proof thanks to caching by WP Super Cache!