diff --git a/app/helpers/pages_helper.rb b/app/helpers/pages_helper.rb index b98e7a8a..f5ceaba7 100644 --- a/app/helpers/pages_helper.rb +++ b/app/helpers/pages_helper.rb @@ -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 diff --git a/app/views/pages/_form.html.haml b/app/views/pages/_form.html.haml index afcc7c87..40e3a466 100644 --- a/app/views/pages/_form.html.haml +++ b/app/views/pages/_form.html.haml @@ -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")