<% @model = Character::Settings::Variable %> <%= simple_form_for :objects, url: @action_url, method: :post, class: :default do |form| %> <%= hidden_field_tag :class_name, @model.to_s %> <% ::Settings.group(@settings_group_name).each do |name, object| %> <%= form.simple_fields_for "[]", object.stored_object do |f| %> <% case object.type %> <% when "file" %> <% when "code" %> <%= f.input :value, as: :text, label: object.name, placeholder: object.description, wrapper_class: 'input ' + object.name.parameterize, input_html: { value: object.value, rows: 6 } %> <% when "text" %> <%= f.input :value, as: :text, label: object.name, placeholder: object.description, wrapper_class: 'input ' + object.name.parameterize, input_html: { value: object.value, rows: 3 } %> <% when "redactor" %> <%= f.input :value, as: :text, label: object.name, placeholder: object.description, wrapper_class: 'input ' + object.name.parameterize, input_html: { value: object.value, rows: 3, class: 'character-redactor' } %> <% when "integer" %> <%= f.input :value, as: :integer, label: object.name, placeholder: object.description, wrapper_class: 'input ' + object.name.parameterize, input_html: { value: object.value } %> <% when "float" %> <%= f.input :value, as: :float, label: object.name, placeholder: object.description, wrapper_class: 'input ' + object.name.parameterize, input_html: { value: object.value } %> <% else %> <%= f.input :value, label: object.name, placeholder: object.description, wrapper_class: 'input ' + object.name.parameterize, input_html: { value: object.value } %> <% end %> <% end %> <% end %> <% end %>