Fixed bad when selecting same page as parent.
This commit is contained in:
parent
5f51afb5ee
commit
f640c673de
2 changed files with 5 additions and 1 deletions
|
@ -48,4 +48,8 @@ module PagesHelper
|
|||
end
|
||||
end
|
||||
end
|
||||
|
||||
def parent_pages_to_select(current_page)
|
||||
Page.non_redirected.reject { |p| p == current_page }
|
||||
end
|
||||
end
|
||||
|
|
|
@ -97,6 +97,6 @@
|
|||
|
|
||||
= link_to "Abbrechen", @page
|
||||
| Oberseite ändern:
|
||||
= collection_select(:page, :parent_id, Page.non_redirected, :id, :permalink, {:prompt => "Neue Oberseite?", :include_blank => true})
|
||||
= collection_select(:page, :parent_id, parent_pages_to_select(@page), :id, :permalink, {:prompt => "Neue Oberseite?", :include_blank => true})
|
||||
|
||||
%div(style="clear:right; height:1px")
|
||||
|
|
Loading…
Reference in a new issue