Skip to content

Latest commit

 

History

History
46 lines (33 loc) · 778 Bytes

simple_form.md

File metadata and controls

46 lines (33 loc) · 778 Bytes
= simple_form_for :custom_form,
  url: root_path,
  method: 'get',
  html: { id: 'fetch_custom_form',
  :'data-remote' => true } do |f|
  = f.input :validation_type_id, collection: @application.tld.validation_types
  

selected via lambda

= f.input :application_strategy,
  required: true,
  collection: Strategy.strategies_for_view,
  selected: lambda { |option| @user.application_strategy == option[0] }

simple form for plain ruby class

class User
  include ActiveModel::Conversion
  extend  ActiveModel::Naming

  attr_accessor :name, age

  def persisted?
    false
  end
end
= simple_for_for User.new do |f|
  = f.input :name
  = f.input :age

bootstrap 3

https://github.com/rafaelfranca/simple_form-bootstrap