README.md in simple_form-3.1.0.rc2 vs README.md in simple_form-3.1.0
- old
+ new
@@ -53,24 +53,24 @@
For more information see the generator output, our
[example application code](https://github.com/rafaelfranca/simple_form-bootstrap) and
[the live example app](http://simple-form-bootstrap.plataformatec.com.br/).
-### Zurb Foundation 3
+### Zurb Foundation 5
-To generate wrappers that are compatible with [Zurb Foundation 3](http://foundation.zurb.com/), pass
+To generate wrappers that are compatible with [Zurb Foundation 5](http://foundation.zurb.com/), pass
the `foundation` option to the generator, like this:
```console
rails generate simple_form:install --foundation
```
Please note that the Foundation wrapper does not support the `:hint` option by default. In order to
enable hints, please uncomment the appropriate line in `config/initializers/simple_form_foundation.rb`.
You will need to provide your own CSS styles for hints.
-Please see the [instructions on how to install Foundation in a Rails app](http://foundation.zurb.com/old-docs/f3/rails.php).
+Please see the [instructions on how to install Foundation in a Rails app](http://foundation.zurb.com/docs/applications.html).
## Usage
**Simple Form** was designed to be customized as you need to. Basically it's a stack of components that
are invoked to create a complete html input for you, which by default contains label, hints, errors
@@ -427,10 +427,16 @@
<% end %>
```
The above will simply call submit. You choose to use it or not, it's just a question of taste.
+The button method also accepts optional parameters, that are delegated to the underlying submit call:
+
+```erb
+<%= f.button :submit, "Custom Button Text", class: "my-button" %>
+```
+
### Wrapping Rails Form Helpers
Say you wanted to use a rails form helper but still wrap it in **Simple Form** goodness? You can, by
calling input with a block like so:
@@ -453,11 +459,11 @@
Wrapper to use **Simple Form** inside a default rails form. It works in the same way that the `fields_for`
Rails helper, but change the builder to use the `SimpleForm::FormBuilder`.
```ruby
form_for @user do |f|
- simple_fields_for :posts do |posts_form|
+ f.simple_fields_for :posts do |posts_form|
# Here you have all simple_form methods available
posts_form.input :title
end
end
```
@@ -545,11 +551,13 @@
```ruby
# app/inputs/currency_input.rb
class CurrencyInput < SimpleForm::Inputs::Base
def input(wrapper_options)
- "$ #{@builder.text_field(attribute_name, input_html_options)}".html_safe
+ merged_input_options = merge_wrapper_options(input_html_options, wrapper_options)
+
+ "$ #{@builder.text_field(attribute_name, merged_input_options)}".html_safe
end
end
```
And use it in your views:
@@ -975,14 +983,23 @@
```erb
<%= simple_form_for(resource, html: { novalidate: true }) do |form| %>
```
-Please notice that any of the configurations above will not disable the `placeholder` component,
-which is an HTML 5 feature. We believe most of the newest browsers are handling this attribute fine,
-and if they aren't, any plugin you use would take of using the placeholder attribute to do it.
-However, you can disable it if you want, by removing the placeholder component from the components
-list in **Simple Form** configuration file.
+Please notice that none of the configurations above will disable the `placeholder` component,
+which is an HTML 5 feature. We believe most of the newest browsers are handling this attribute
+just fine, and if they aren't, any plugin you use would take care of applying the placeholder.
+In any case, you can disable it if you really want to, by removing the placeholder component
+from the components list in the **Simple Form** configuration file.
+
+HTML 5 date / time inputs are not generated by **Simple Form** by default, so using `date`,
+`time` or `datetime` will all generate select boxes using normal Rails helpers. We believe
+browsers are not totally ready for these yet, but you can easily opt-in on a per-input basis
+by passing the html5 option:
+
+```erb
+<%= f.input :expires_at, as: :date, html5: true %>
+```
## Information
### Google Group