Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def update
- @coach = Coach.find(params[:id])
- @coach.activated = params[:coach][:activated] == "1"
- @coach.active = params[:coach][:active] == "1"
- if @coach.update_attributes(params[:coach])
- flash[:notice] = "Coach has been successfully updated"
- else
- flash[:error] = @coach.errors.full_messages.join(", ")
- end
- redirect_to "/admin/coaches/edit/#{params[:id]}"
- end
Add Comment
Please, Sign In to add comment