Guest User

Untitled

a guest
Jun 22nd, 2018
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. def update
  2. @department = Department.find(params[:id])
  3.  
  4. respond_to do |format|
  5. if @department.update_attributes(params[:department])
  6. flash[:notice] = 'Department was successfully updated.'
  7. format.html { redirect_to(@department) }
  8. format.xml { head :ok }
  9. else
  10. format.html { render :action => "edit", :layout => "main" }
  11. format.xml { render :xml => @department.errors, :status => :unprocessable_entity }
  12. end
  13. end
  14. end
Add Comment
Please, Sign In to add comment