Guest User

Untitled

a guest
Aug 14th, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. def update
  2. @coach = Coach.find(params[:id])
  3. @coach.activated = params[:coach][:activated] == "1"
  4. @coach.active = params[:coach][:active] == "1"
  5. if @coach.update_attributes(params[:coach])
  6. flash[:notice] = "Coach has been successfully updated"
  7. else
  8. flash[:error] = @coach.errors.full_messages.join(", ")
  9. end
  10. redirect_to "/admin/coaches/edit/#{params[:id]}"
  11. end
Add Comment
Please, Sign In to add comment