|
1 | 1 | <h3>Horizontal Form</h3> |
2 | 2 |
|
3 | 3 | <%= form_with_source do %> |
4 | | - <%= bootstrap_form_with model: @user, layout: :horizontal, local: true do |form| %> |
| 4 | + <%= bootstrap_form_with model: @user, layout: :horizontal, local: true, namespace: "horizontal" do |form| %> |
5 | 5 | <%= form.email_field :email, placeholder: "Enter Email", label: "Email address", help: "We'll never share your email with anyone else" %> |
6 | 6 | <%= form.password_field :password, placeholder: "Password" %> |
7 | 7 | <%= form.select :status, [['activated', 1], ['blocked', 2]], prompt: "Please Select" %> |
|
20 | 20 | <h3>With Validation Error</h3> |
21 | 21 |
|
22 | 22 | <%= form_with_source do %> |
23 | | - <%= bootstrap_form_for @user_with_error, layout: :horizontal do |form| %> |
| 23 | + <%= bootstrap_form_for @user_with_error, layout: :horizontal, namespace: "validation_error" do |form| %> |
24 | 24 | <%= form.alert_message "This is an alert" %> |
25 | 25 | <%= form.error_summary %> |
26 | 26 | <%= form.email_field :email, placeholder: "Enter Email", label: "Email address", help: "We'll never share your email with anyone else" %> |
|
32 | 32 | <h3>Inline Form</h3> |
33 | 33 |
|
34 | 34 | <%= form_with_source do %> |
35 | | - <%= bootstrap_form_for @user, layout: :inline do |form| %> |
| 35 | + <%= bootstrap_form_for @user, layout: :inline, namespace: "inline_form" do |form| %> |
36 | 36 | <%= form.email_field :email, placeholder: "Enter Email", label: "Email address", help: "We'll never share your email with anyone else" %> |
37 | 37 | <%= form.password_field :password, placeholder: "Password" %> |
38 | 38 | <%= form.checkbox :terms, label: "Agree to Terms" %> |
|
44 | 44 | <h3>Simple Action Text Example</h3> |
45 | 45 |
|
46 | 46 | <%= form_with_source do %> |
47 | | - <%= bootstrap_form_for @user, url: "/" do |form| %> |
| 47 | + <%= bootstrap_form_for @user, url: "/", namespace: "action_text" do |form| %> |
48 | 48 | <%= form.email_field :email, placeholder: "Enter Email", label: "Email address", help: "We'll never share your email with anyone else" %> |
49 | 49 | <%= form.password_field :password, placeholder: "Password" %> |
50 | 50 | <%= form.checkbox :terms, label: "Agree to Terms" %> |
|
57 | 57 | <h3>Floating Labels</h3> |
58 | 58 |
|
59 | 59 | <%= form_with_source do %> |
60 | | - <%= bootstrap_form_for @user do |form| %> |
| 60 | + <%= bootstrap_form_for @user, namespace: "floating_label" do |form| %> |
61 | 61 | <%= form.email_field :email, placeholder: "Enter Email", label: "Email address", help: "We'll never share your email with anyone else", floating: true %> |
62 | 62 | <%= form.password_field :password, placeholder: "Password", floating: true %> |
63 | 63 | <%= form.text_field :misc, floating: true %> |
|
0 commit comments