<%= devise_error_messages! %> <%= f.input :collection_id, as: :hidden %> <%= f.input :title %> <%= f.input :description %> <%= f.input( :plugin, collection: Setting['home_page.general.plugins'].map do |p| p = p == 'home_page' ? 'home' : p.gsub('home_page_', ''); [p.humanize.titleize, p] end, input_html: { data: { 'setting-url' => setting_path('show', id2: 'x') }} ) %> <%= f.input( :partial_path, collection: if f.object.plugin.present? Setting["#{(f.object.plugin == 'home' ? 'home_page' : 'home_page_' + f.object.plugin)}.general.partial_paths"] else [] end ) %>
<%= f.text_field :published_from, class: 'form-control' %>
<%= f.text_field :published_until, class: 'form-control' %>