Skip to content

Commit

Permalink
requested_friendly_id needed to split on hash
Browse files Browse the repository at this point in the history
  • Loading branch information
jadehopepunk authored and parndt committed Feb 13, 2012
1 parent 8b075b7 commit be44ae2
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions pages/app/controllers/refinery/pages_controller.rb
Expand Up @@ -34,30 +34,30 @@ def show
else
render_with_templates?
end
end
end
else
error_404
end
end

protected

def requested_friendly_id
[params[:id], params[:path]].detect(&:present?)
"#{params[:path]}/#{params[:id]}".split('/').last
end

def should_skip_to_first_child?
@page.skip_to_first_child && first_live_child
end

def current_user_can_view_page?
@page.live? || current_refinery_user_can_access?("refinery_pages")
end
end

def current_refinery_user_can_access?(plugin)
refinery_user? && current_refinery_user.authorized_plugins.include?(plugin))
refinery_user? && current_refinery_user.authorized_plugins.include?(plugin)
end

def first_live_child
@page.children.order('lft ASC').live.first
end
Expand Down

0 comments on commit be44ae2

Please sign in to comment.