Why not user update on ruby on rails

Hi All, I can’t update my user information.

This is controller

def edit
@users= current_user
end

def update
@users= current_user
if @users.update_attributes(user_params)
# Handle a successful update.
flash[:notice] = “Your profile updated”
render ‘edit’
else
render ‘edit’
end
end

private

def user_params
params.require(:users).permit(:first_name, :last_name, :father_name,
:mother_name )
end

View
<%= form_for :users, url: upload_resumes_path(@users), action: :update,
method: :post do |f| %>
<%= f.text_field :first_name %>
<%= f.text_field :last_name %>
<%= f.text_field :father_name %>
<%= f.text_field :mother_name %>
<%= f.submit “Submit” %>
<% end %>

Routes:
get ‘users’ => ‘users#edit’
post ‘users’ => ‘users#update’

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs