Skip to content

Instantly share code, notes, and snippets.

@ryansobol
Created September 19, 2014 19:37
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 ryansobol/b7fa8799a0fea11794fe to your computer and use it in GitHub Desktop.
Save ryansobol/b7fa8799a0fea11794fe to your computer and use it in GitHub Desktop.
# 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