I would like to ask, if is some rule for action, where is the form send… If I have a in controller
def edit
@shop = Shop.find(params[:id])
end
View:
<%= form_for(@shop, :html => {:multipart => true}) do |f| %>
So in HTML source is:
<form accept-charset="UTF-8" action="/shops/11" class="edit_shop" enctype="multipart/form-data" id="edit_shop_11" method="post">
And this mean, this form will be send on :controller => ‘shops’, :action => ‘update’.
And I am trying to change this action, where will be form send. I tried something like this:
<%= form_for(@shop, :url => {:controller => 'shops', :id => params[:id], :action => 'aupdate'}, :html => {:multipart => true}) do |f| %>
But in HTML source is
<form accept-charset="UTF-8" action="/shops/aupdate?id=11" class="edit_shop" enctype="multipart/form-data" id="edit_shop_11" method="post">
I would like to ask – how is possible, the form is not send on the action update in this case? And what would be needed to do for it?
Thank you
in your view:
in your routes:
in your controller: