Created
October 14, 2012 15:05
-
-
Save svs/3888854 to your computer and use it in GitHub Desktop.
update action
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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