Submit form_for to Custom Action – Ruby on Rails

Just another quick problem I ran into with rails this afternoon – how to submit a form_for to a custom action. Luckily there’s quite a bit on how to do this in the documentation, my solution ended up as follows:

 url_for(:controller => 'feedbacks', :action => 'leave_seller_feedback') do |f| %>

Just substitute your form_for tag with the one above and put in the relevant details and it should all work fine. Keep in mind that the submit tag doesn’t need to be changed, just the form_for tag.

Advertisements

One thought on “Submit form_for to Custom Action – Ruby on Rails

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s