Created
September 19, 2014 19:37
-
-
Save ryansobol/b7fa8799a0fea11794fe to your computer and use it in GitHub Desktop.
This file contains 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 /articles | |
def create | |
@article = Article.new(article_params) | |
if @article.save | |
redirect_to @article, notice: 'Article was successfully created.' | |
else | |
render :new | |
end | |
end | |
# PATCH/PUT /articles/1 | |
def update | |
if @article.update(article_params) | |
redirect_to @article, notice: 'Article was successfully updated.' | |
else | |
render :edit | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment