Skip to content

Instantly share code, notes, and snippets.

@svs
Created August 28, 2012 09:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save svs/3496733 to your computer and use it in GitHub Desktop.
Save svs/3496733 to your computer and use it in GitHub Desktop.
update action
# API is POST {:action => "update", :event => "approve", :id => 3, :document => {:comment => "some comment"}}
def update
@document = Document.get(params[:id])
if @document.send(params[:event], current_user)
@document.update_attributes(params[:document])
end
respond_to do |format|
# ...
# ...
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment