Skip to content

Instantly share code, notes, and snippets.

@almaron
Created May 4, 2012 10:30
Show Gist options
  • Save almaron/2593943 to your computer and use it in GitHub Desktop.
Save almaron/2593943 to your computer and use it in GitHub Desktop.
def show
@forum = Forum::Forum.find_by_id(params[:id])
if @forum.hidden && !(user_in?([:admins, :masters]) || user_permitted?(:show_hidden))
url = case @forum.parent_id
when 0 then forum_index_path
else forum_path(@forum.parent)
end
redirect_to url
end
rendering the forum
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment