Skip to content

Instantly share code, notes, and snippets.

@almaron
Created June 17, 2014 13:16
Show Gist options
  • Save almaron/7baa1b62611a9dfa6b86 to your computer and use it in GitHub Desktop.
Save almaron/7baa1b62611a9dfa6b86 to your computer and use it in GitHub Desktop.
def get_topic
@topic = ForumTopic.find(params[:id])
unless @topic
respond_to do |format|
format.html { redirect_to forum_path(params[:forum_id]) }
format.json { render json: {redirect: forum_path(params[:forum_id])}, status: 500 }
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment