kk, I will paste it in . I could be brain farting, but I am not sure
Form:
<%= form_for @user, remote: true do |f|%>
<%= f.label :password %>
<%= f.password_field :password, class: 'form-control' %><br>
<%= f.submit "Save", class: "btn btn-primary" %>
controller action
def update
@user = User.find(params[:id])
@user.password= params[:password]
if @user.save!
flash[:success] = "password updated"
redirect_to root_path
else
redirect_to edit_path(@user)
end
Routes:
get "users/edit/:id" => 'users#edit', :as => :edit