Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
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