Skip to content

Instantly share code, notes, and snippets.

@jraczak
Created March 2, 2012 03:25
Show Gist options
  • Select an option

  • Save jraczak/1955330 to your computer and use it in GitHub Desktop.

Select an option

Save jraczak/1955330 to your computer and use it in GitHub Desktop.
def create
@article = current_user.articles.new(params[:article])
respond_to do |format|
if @article.save
format.html { redirect_to(@article, :notice => t('articles.create_success')) }
format.xml { render :xml => @article, :status => :created, :location => @article }
else
format.html { render :action => "new" }
format.xml { render :xml => @article.errors, :status => :unprocessable_entity }
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment