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.


Posted

in

,

by

Comments

One response to “Submit form_for to Custom Action – Ruby on Rails”

  1. anthonypenner Avatar

    Thanks! I broke this as well!

    Like

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 )

Facebook photo

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

Connecting to %s

Create a website or blog at WordPress.com

%d bloggers like this: