-
Notifications
You must be signed in to change notification settings - Fork 283
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
de441c5
commit 931c466
Showing
3 changed files
with
24 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,22 @@ | ||
<%= simple_form_for :article do |f| %> | ||
<%= simple_form_for :article, wrapper_mappings: { | ||
check_boxes: :vertical_radio_button, | ||
radio_buttons: :vertical_radio_button, | ||
file: :vertical_file_input, | ||
boolean: :vertical_check_box | ||
} do |f| %> | ||
<%= f.input :my_email, as: :string, label: 'Email Address' %> | ||
|
||
<%= f.input :my_password, as: :password, label: 'Password' %> | ||
|
||
<%= f.input :my_file, as: :file, label: 'File input', wrapper: :vertical_file_input %> | ||
<%= f.input :my_file, as: :file, label: 'File input' %> | ||
|
||
<%= f.input :my_checkbox, as: :boolean, label: 'Check me out', :wrapper => :vertical_check_box %> | ||
<%= f.input :my_checkbox, as: :boolean, label: 'Check me out' %> | ||
|
||
<%= f.input :my_checkboxes, as: :check_boxes, label: 'This is a checkbox', | ||
collection: ["Option one is this and that—be sure to include why it's great", "Option two can be something else and selecting it will deselect option one"], | ||
wrapper: :vertical_radio_button %> | ||
collection: ["Option one is this and that—be sure to include why it's great", "Option two can be something else and selecting it will deselect option one"] %> | ||
|
||
<%= f.input :my_radio_buttons, as: :radio_buttons, label: 'This is a radio button', | ||
collection: ["Option one is this and that—be sure to include why it's great", "Option two can be something else and selecting it will deselect option one"], | ||
wrapper: :vertical_radio_button %> | ||
collection: ["Option one is this and that—be sure to include why it's great", "Option two can be something else and selecting it will deselect option one"] %> | ||
|
||
<%= f.button :submit %> | ||
<% end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,22 @@ | ||
<%= simple_form_for :article, wrapper: :bootstrap_horizontal, html: { class: 'form-horizontal' } do |f| %> | ||
<%= simple_form_for :article, html: { class: 'form-horizontal' }, wrapper: :bootstrap_horizontal, wrapper_mappings: { | ||
check_boxes: :horizontal_radio_button, | ||
radio_buttons: :horizontal_radio_button, | ||
file: :horizontal_file_input, | ||
boolean: :horizontal_check_box | ||
} do |f| %> | ||
<%= f.input :my_email, as: :string, label: 'Email' %> | ||
|
||
<%= f.input :my_password, as: :password, label: 'Password' %> | ||
|
||
<%= f.input :my_file, as: :file, label: 'File input', wrapper: :horizontal_file_input %> | ||
<%= f.input :my_file, as: :file, label: 'File input' %> | ||
|
||
<%= f.input :my_checkbox, as: :boolean, label: 'Remember me', :wrapper => :horizontal_check_box %> | ||
<%= f.input :my_checkbox, as: :boolean, label: 'Remember me' %> | ||
|
||
<%= f.input :my_checkboxes, as: :check_boxes, label: 'A couple of checkboxes', | ||
collection: ["Option one is this and that—be sure to include why it's great", "Option two can be something else and selecting it will deselect option one"], | ||
wrapper: :horizontal_radio_button %> | ||
collection: ["Option one is this and that—be sure to include why it's great", "Option two can be something else and selecting it will deselect option one"] %> | ||
|
||
<%= f.input :my_radio_buttons, as: :radio_buttons, label: 'A couple of radio button', | ||
collection: ["Option one is this and that—be sure to include why it's great", "Option two can be something else and selecting it will deselect option one"], | ||
wrapper: :horizontal_radio_button %> | ||
collection: ["Option one is this and that—be sure to include why it's great", "Option two can be something else and selecting it will deselect option one"] %> | ||
|
||
<%= f.button :submit %> | ||
<% end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,11 @@ | ||
<%= simple_form_for :article, defaults: { label: false }, html: { class: 'form-inline' } do |f| %> | ||
<%= simple_form_for :article, defaults: { label: false }, html: { class: 'form-inline' }, wrapper_mappings: { | ||
boolean: :vertical_check_box | ||
} do |f| %> | ||
<%= f.input :email, as: :string, placeholder: 'Email Address' %> | ||
|
||
<%= f.input :password, as: :password, placeholder: 'Password' %> | ||
|
||
<%= f.input :checkbox, as: :boolean, inline_label: 'Remember me', :wrapper => :vertical_check_box %> | ||
<%= f.input :checkbox, as: :boolean, inline_label: 'Remember me' %> | ||
|
||
<%= f.button :submit %> | ||
<% end %> |