Fixed bad when selecting same page as parent.

This commit is contained in:
Benjamin Meichsner 2010-07-08 10:57:42 +02:00
parent 5f51afb5ee
commit f640c673de
2 changed files with 5 additions and 1 deletions

View file

@ -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

View file

@ -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")