Skip to content

Instantly share code, notes, and snippets.

@svs
Created October 14, 2012 15:05
Show Gist options
  • Save svs/3888854 to your computer and use it in GitHub Desktop.
Save svs/3888854 to your computer and use it in GitHub Desktop.
update action
# POST {:id => <article_id>, :action => :update, :set_state => :published, :article => {:title => "foo"}}
def update
@article = Article.find(params[:id])
@article.update!(params) # we call a method in Article which deals with our params
...
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment