/ -# TODO: put the parent and slug side by side and name the new field URL / -# also maybe change the dropdown to an autocomplete / -# f.input :parent_url, :collection => Cardboard::Page.preordered.all.inject(["/"]){|result, elm| result << elm.url unless elm.id == @page.id; result}, include_blank: false = f.input :url, required: true, wrapper_html:{class: f.object.errors.messages[:slug] ? "error" : nil}, hint: f.object.root? ? "This page is your home page" : nil do - if f.object.root? .btn(disabled)=> "/" ' or .input-prepend style="display:inline" .add-on - if @page.new_record? = f.select :parent_url, options_for_select(@page.parent_url_options, f.object.parent_url) - else = f.object.parent_url = f.text_field :slug br = f.error :slug