title: rails redirect_to after database update
body: <p>hy, i have a form to change the current language. It is associate an update action in users_controller like this:</p>
  
  <pre><code>&lt;%= form_for current_user do |f| %&gt;
   &lt;%= f.select :locale, [['En', 'en'], ['Pt', 'pt']] %&gt;
   &lt;%= f.submit %&gt;
  &lt;% end %&gt;
  
  
  class UsersController &lt; ApplicationController
   def update  
    @user.update(user_params)
    I18n.locale=@user.locale
    redirect_to root_path
   end
  
   def user_params
    params.require(:user).permit(:locale)
   end
  end
  </code></pre>
  
  <p>After the update i don't want to redirect_to root_path but i want to redirect_to :back but with the locale parameter sets according with the update.
  I have no idea, can you help me? </p>