-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #569 from dlee/add_inline_label_to_readme
Add docs for inline_label to README (Issue #568)
- Loading branch information
Showing
1 changed file
with
2 additions
and
1 deletion.
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 |
---|---|---|
|
@@ -69,13 +69,14 @@ This will generate an entire form with labels for user name and password as well | |
by default when you render the form with invalid data (after submitting for example). | ||
|
||
You can overwrite the default label by passing it to the input method. You can also add a hint or | ||
even a placeholder: | ||
even a placeholder. For boolean inputs, you can add an inline label as well: | ||
|
||
```erb | ||
<%= simple_form_for @user do |f| %> | ||
<%= f.input :username, :label => 'Your username please' %> | ||
<%= f.input :password, :hint => 'No special characters.' %> | ||
<%= f.input :email, :placeholder => '[email protected]' %> | ||
<%= f.input :remember_me, :inline_label => '<b>Yes, remember me</b>'.html_safe %> | ||
<%= f.button :submit %> | ||
<% end %> | ||
``` | ||
|