Avoid setting page as parent id, which has current page as parent.
This commit is contained in:
parent
20b7db306b
commit
6c82d0e06a
3 changed files with 14 additions and 6 deletions
|
|
@ -50,6 +50,10 @@ module PagesHelper
|
|||
end
|
||||
|
||||
def parent_pages_to_select(current_page)
|
||||
Page.non_redirected.reject { |p| p == current_page }
|
||||
unless current_page.homepage? # Homepage is the page trees root!
|
||||
Page.non_redirected.reject { |p| p == current_page or p.ancestors.include?(current_page) }
|
||||
else
|
||||
Array.new
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue