Skip to content

Instantly share code, notes, and snippets.

@dennermiranda
Created December 8, 2010 16:54
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 dennermiranda/733543 to your computer and use it in GitHub Desktop.
Save dennermiranda/733543 to your computer and use it in GitHub Desktop.
Create
def create
@topic = Topic.new(params[:topic])
respond_to do |format|
if @topic.save
format.html { redirect_to(@topic, :notice => 'Topic was successfully created.') }
format.xml { render :xml => @topic, :status => :created, :location => @topic }
else
format.html { render :action => "new" }
format.xml { render :xml => @topic.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