Skip to content

Instantly share code, notes, and snippets.

@rhynix
Created May 31, 2009 20:05
Show Gist options
  • Save rhynix/121012 to your computer and use it in GitHub Desktop.
Save rhynix/121012 to your computer and use it in GitHub Desktop.
def update
@subject = Subject.find(params[:id])
respond_to do |format|
if @subject.update_attributes(params[:subject])
flash[:notice] = 'Subject was successfully updated.'
format.html { redirect_to(@subject) }
format.xml { head :ok }
else
format.html { render :action => "edit" }
format.xml { render :xml => @subject.errors, :status => :unprocessable_entity }
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment