Created
December 23, 2011 22:19
-
-
Save samrose/1515524 to your computer and use it in GitHub Desktop.
controller create
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
def create | |
#@forum = Forum.find(params[:forum_id]) | |
#params[:forum_topic][:forum_id] | |
@forum_topic = ForumTopic.new(params[:forum_topic]) | |
respond_to do |format| | |
if @forum_topic.save | |
format.html { redirect_to forum_forum_topic_path, notice: 'Forum topic was successfully created.' } | |
format.json { render json: @forum_topic, status: :created, location: @forum_topic } | |
else | |
format.html { render action: "new" } | |
format.json { render json: @forum_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