<%= simple_form_for(@entry, as: :entry, url: @entry.persisted? ? content_entry_path(@entry) : entries_path) do |f| %> <%= f.hidden_field :type, value: @entry.type %> <%= f.input :title %> <% @entry.class.content_attributes.each do |attr_name, attr_type| %> <%= f.input attr_name, as: attr_type %> <% end %> <%= f.input :slug %> <%= f.input :author_name %> <%= f.input :published_at %> <%= f.submit "Save", class: "btn btn-primary" %> <% end %>