1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

AV Helper guide fixes- (#39679)

- Fix spacing on output
- Fix short forms usage
[ci skip]
This commit is contained in:
Vipul A M 2020-06-20 21:23:43 +05:30 committed by GitHub
parent 36b44ca9f7
commit 9caf09ef19
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -269,8 +269,10 @@ datetime_select("article", "published_on")
Reports the approximate distance in time between two Time or Date objects or integers as seconds. Set `include_seconds` to true if you want more detailed approximations.
```ruby
distance_of_time_in_words(Time.now, Time.now + 15.seconds) # => less than a minute
distance_of_time_in_words(Time.now, Time.now + 15.seconds, include_seconds: true) # => less than 20 seconds
distance_of_time_in_words(Time.now, Time.now + 15.seconds)
# => less than a minute
distance_of_time_in_words(Time.now, Time.now + 15.seconds, include_seconds: true)
# => less than 20 seconds
```
#### select_date
@ -764,7 +766,7 @@ NOTE: Only the `option` tags are returned, you have to wrap this call in a regul
Returns a string of option tags that have been compiled by iterating over the `collection` and assigning the result of a call to the `value_method` as the option value and the `text_method` as the option text.
```ruby
# options_from_collection_for_select(collection, value_method, text_method, selected = nil)
options_from_collection_for_select(collection, value_method, text_method, selected = nil)
```
For example, imagine a loop iterating over each person in `@project.people` to generate an input tag:
@ -1157,7 +1159,7 @@ would output:
</a>
```
See [the API Doc for more info](https://api.rubyonrails.org/classes/ActionView/Helpers/UrlHelper.html#method-i-link_to)
See [the API Documentation for more information](https://api.rubyonrails.org/classes/ActionView/Helpers/UrlHelper.html#method-i-link_to)
#### button_to
@ -1178,7 +1180,7 @@ would roughly output something like:
</form>
```
See [the API Doc for more info](https://api.rubyonrails.org/classes/ActionView/Helpers/UrlHelper.html#method-i-button_to)
See [the API Documentation for more information](https://api.rubyonrails.org/classes/ActionView/Helpers/UrlHelper.html#method-i-button_to)
### CsrfHelper