Skip to content

Instantly share code, notes, and snippets.

@samrose
Created December 23, 2011 22:19
Show Gist options
  • Save samrose/1515524 to your computer and use it in GitHub Desktop.
Save samrose/1515524 to your computer and use it in GitHub Desktop.
controller create
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