### 安裝

$bundle install 安裝gem $ rails generate simple_form:install 安裝simple_form
\$ rails generate simple_form:install —bootstrap 安装 simple_form for bootstrap

### 使用

#### 現在可以追加幾種用法

label 設定標題-default欄位名稱
error在model設定validates後統一出現的錯誤訊息
hint在input欄位下方的提示訊息
placeholder沒有特別的
inline_label給欄位為布林值用的-checkbox, radiobox

#### 現在validates不一定要寫在model可以直接寫在html裡面

By default all inputs are required. When the form object includes ActiveModel::Validations (which, for example, happens with Active Record models), fields are required only when there is presence validation. Otherwise, Simple Formwill mark fields as optional. For performance reasons, this detection is skipped on validations that make use of conditional options, such as :if and :unless.
And of course, the required property of any input can be overwritten as needed

#### 可以直接更改input type

as: :select可以製造出dropdown效果

So instead of a checkbox for the accepts attribute, you'll have a pair of radio buttons with yes/no labels and a textare instead of a text field for the description. You can also render boolean attributes using as: :select to show a dropdown.

#### simple_form可以把label, hint, input_field, error and full_error等等拆開讓他們各自是一個tag

Simple Form also allows you to use label, hint, input_field, error and full_error helpers (please take a look at the rdocs for each method for more info

#### 特別的Collections功能

Collections可以為一個陣列-也可以搭配兩個參數客製化select, radiobox等等
label_method -顯示標題
value_method -實際得到的值