My Artist conroller, edit method looks like this
def edit
@user = User.find(params[:id])
end
In the view (artists/edit.html.erb), I have:
<%= form_for(@artist) do |f| %>
<ul>
<li class="clearfix">
<%= f.label :name %>
<%= f.text_field :name %>
</li>
...
</ul>
<%= image_submit_tag('update.png', :class => 'submit') %>
<% end %>
However, when rendered. The form element submits to the user controller, update method (i.e. ).
How do I make it submit to the artist controller, update method instead?
I think you want to change the form_for parameters :
Cf http://api.rubyonrails.org/classes/ActionView/Helpers/FormHelper.html#method-i-form_for
Also, are you sure your @artist points to @user ? I think you meant, in your controller :