Skip to content

Instantly share code, notes, and snippets.

@davidpots
Created March 13, 2013 13:42
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 davidpots/5152154 to your computer and use it in GitHub Desktop.
Save davidpots/5152154 to your computer and use it in GitHub Desktop.
def create
@project_todo_comment = ProjectTodoComment.new(params[:project_todo_comment])
@project_todo = ProjectTodo.find(@project_todo_comment.project_todo_id)
@project = Project.find(@project_todo.project_id)
respond_to do |format|
if @project_todo_comment.save
format.html { redirect_to project_url(@project.id), notice: 'Project todo comment was successfully created.' }
format.json { render json: @project_todo_comment, status: :created, location: @project_todo_comment }
else
format.html { render action: "new" }
format.json { render json: @project_todo_comment.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