Я пытаюсь обновить настройки моего профиля, используя флажки на странице настроек.После того, как флажок установлен, я хочу перенаправить на страницу настроек, поэтому я добавил новое действие в мой контроллер, которое обновляет профиль, но перенаправляет на настройки.Однако я получаю следующую ошибку:
`No route matches {:action=>"edit_settings", :controller=>"profiles"}`
Вот мой код form_for
:
<%= form_tag({:action => "edit_settings", :controller => "profiles"}, :html => {:multipart => true }) do |f| %>
Мое edit_settings
действие в моем profiles
контроллере:
def edit_settings
@profile = user.profile
if @profile.update_attributes(params[:profile])
redirect_to settings_path, :notice => 'Updated user information successfully.'
else
render :edit
end
end
Внутри моего routes.rb
файла:
resources :profiles do
post :edit_settings
end
Внутри rake routes
:
profile_edit_settings POST /profiles/:profile_id/edit_settings(.:format) {:action=>"edit_settings", :controller=>"profiles"}