Commit Graph

1110 Commits

Author SHA1 Message Date
Prakash Laxkar
0c5c88243b Add test cases for checkbox_tag 2015-10-01 08:43:14 +05:30
Akshay Vishnoi
c293eca83f Add test case for text_field_tag 2015-10-01 00:28:52 +05:30
Prakash Laxkar
62b74d2b60 Improve readability of docs by using code tag [ci skip] 2015-09-29 14:44:17 +05:30
Rafael Mendonça França
0131c70175 Merge pull request #21661 from akshay-vishnoi/submit_tag_tests
Fix - Prevent adding of `data-disable-with` option twice in html.
2015-09-29 02:05:07 -03:00
Akshay Vishnoi
23a658ae59 Fix names of test cases 2015-09-29 10:08:30 +05:30
Rafael Mendonça França
30c67000ca Merge pull request #21790 from yui-knk/fix_doc_date_field
[ci skip] Fix which method `FormHelper#date_field` try to call
2015-09-28 00:09:14 -03:00
yui-knk
a314879a96 [ci skip] Fix which method FormHelper#date_field try to call
When this method was implemented
(https://github.com/rails/rails/pull/5016/files), `to_date` is called.
But this behavior was chagned refactoring
(https://github.com/rails/rails/pull/6452/files).
In the first commit, there were not test which asserts `to_date` is called.

I think trying `to_date` is more useful than trying `strftime`, because
we can write `"2015-01-01".to_date`. But first fix comments to match
actual behavior.
2015-09-27 23:51:21 +09:00
Mehmet Emin İNAÇ
7c2104032b minor doc fix [ci skip] 2015-09-27 05:57:21 +03:00
Kasper Timm Hansen
1d02cba939 Merge pull request #21781 from ronakjangir47/partial_caching_test
Added test cases where collection partial cached & rendered with different keys
2015-09-26 23:06:56 +02:00
Ronak Jangir
5e32b90245 Added test cases where collection partial cached for different key and rendered for different key 2015-09-26 20:19:31 +05:30
Rafael Mendonça França
5b64835601 Merge pull request #21431 from ojab/master
Handle nested fields_for by adding indexes to record_name
2015-09-26 01:51:41 -03:00
Mauro George
578bc4b595 Regression test on CollectionCheckBoxes to accept include_hidden
as string
2015-09-24 19:58:21 -03:00
Mauro George
491013e06d Add a hidden field on the collection_radio_buttons
This will avoid a error be raised when the only input on the form is the
`collection_radio_buttons`.
2015-09-24 19:58:15 -03:00
Yves Senn
8842ce2395 Merge pull request #21712 from amitsuroliya/html_fix
Correcting output of `file_field` with `multiple` attribute option [ci skip]
2015-09-22 10:35:47 +02:00
amitkumarsuroliya
851760c0e1 Correcting output of file_field with multiple attribute option [ci skip] 2015-09-22 14:02:24 +05:30
amitkumarsuroliya
f077cc6f41 Correcting output of number_to_percentage example in number_helper [ci skip]
Here is correct output of `number_to_percentage(100, format: "%n  %”)`
2015-09-22 07:38:02 +05:30
Aaron Patterson
d74c8e53b8 compare arrays not set objects. 2015-09-21 14:55:34 -07:00
Sean Griffin
b223d729d8 Merge pull request #21612 from ronakjangir47/remove_unused_params
Removed unused parameter `options` for `register_detail` method
2015-09-21 08:30:43 -06:00
Akira Matsuda
64766e82d6 🔪 Typos 2015-09-21 03:17:39 +09:00
Akira Matsuda
c971bc0568 ✂️ empty line at the top of files 2015-09-21 01:27:33 +09:00
Jerry D'Antonio
56ac6e4768 Replaced ThreadSafe::Map with successor Concurrent::Map.
The thread_safe gem is being deprecated and all its code has been merged
into the concurrent-ruby gem. The new class, Concurrent::Map, is exactly
the same as its predecessor except for fixes to two bugs discovered
during the merge.
2015-09-19 09:56:26 -04:00
Aaron Patterson
38d2bf5fd1 mostly remove the ParamsParser middleware
This can still be added to the middleware stack, but is really not
necessary.  I'll follow up with a commit that deprecates the constant
2015-09-18 15:36:55 -07:00
Kasper Timm Hansen
77370f27db Merge pull request #21632 from kirs/feature/translation-helper-include-interpolation
Include interpolation values to translation_missing helper
2015-09-18 21:37:28 +02:00
Kir Shatrov
0f138d1a8b Include interpolation values to translation_missing helper 2015-09-18 20:04:36 +03:00
Akira Matsuda
dcecbb4234 File encoding is defaulted to utf-8 in Ruby >= 2.1 2015-09-18 17:05:05 +09:00
Akshay Vishnoi
9331f00229 Fix - Prevent adding of data-disable-with option twice in html.
Earlier
when `data-disable-with` option is added direclty as in options then

```ruby
submit_tag("Save", { "data-disable-with" => "Processing..." })
# => <input type="submit" name="commit" value="Save" data-disable-with="Processing..." data-disable-with="Processing..." />
```

Now
when `data-disable-with` option is added direclty as in options then

```ruby
submit_tag("Save", { "data-disable-with" => "Processing..." })
# => <input type="submit" name="commit" value="Save" data-disable-with="Processing..." />
```
2015-09-18 12:44:09 +05:30
shingo.nakanishi
30eabcb921 No need the a 2015-09-17 23:18:22 +09:00
shingo.nakanishi
66d6cab987 Fixed helpers submit button Examples [ci skip] 2015-09-17 17:06:54 +09:00
Ronak Jangir
e46a117a4c Removed unused parameter options for register_detail method
This method is only called with name & block.
2015-09-13 21:54:10 +05:30
amitkumarsuroliya
ee8feecc57 fix typo intance -> instance in ActionView [ci skip]
`intance` should be `instance`
2015-09-13 20:18:10 +05:30
Rafael Mendonça França
f883867dd6 Merge pull request #21502 from bernerdschaefer/bs-polymorphic-url_for-dups-arguments
`url_for` does not modify polymorphic options
2015-09-08 13:49:22 -03:00
Kasper Timm Hansen
b5a489fc9c Merge pull request #21480 from amitsuroliya/add_return_value_description
adding description of return value [ci skip]
2015-09-07 07:48:12 +02:00
Aaron Patterson
f443ae670d Use ERB::Utils to percent encode hfvalue parts of mailto
`hfvalue` parts should always be percent encoded, so lets do that!

Revert "use path escaping for email addresses"

This reverts commit 21ffef38a5dc5a6a21f7e841aecab5b51f4fd185.
2015-09-05 10:59:46 -07:00
Aaron Patterson
21ffef38a5 use path escaping for email addresses
Due to e25fdad2f147e6f368958f9a06a5ac9d10288408, we are correctly using
path escaping for email addresses.  This commit fixes the tests to
expect path escaping.
2015-09-04 15:20:07 -07:00
Bernerd Schaefer
ee63532d40 url_for does not modify polymorphic options
The `url_for` methods in `actionpack` and `actionview`
now make a copy of the provided options
before generating polymorphic paths or URLs.

The bug in the previous behavior
is most noticeable in a case like:

    url_options = [:new, :post, param: 'value']

    if current_page?(url_options)
      css_class = "active"
    end

    link_to "New Post", url_options, class: css_class
2015-09-04 13:42:32 -07:00
amitkumarsuroliya
ddc05b61e0 adding description of return value [ci skip] 2015-09-03 17:22:36 +05:30
ojab
7089768b70 Handle nested fields_for by adding indexes to record_name
In case of the form with nested fields_for, i. e.

<%= form_for :foos, url: root_path do |f| %>
    <% @foos.each do |foo| %>
        <%= f.fields_for 'foo[]', foo do |f2| %>
            <%= f2.text_field :id %>
            <% foo.bars.each do |bar| %>
                <%= f2.fields_for 'bar[]', bar do |b| %>
                    <%= b.text_field :id %>
                <% end %>
            <% end %>
        <% end %>
     <% end %>
    <%= f.submit %>
<% end %>

rails doesn't add index for 'foo' in the inner fields_for block, so field names
in the outer fields_for looks like "foos[foo][#{foo_index}][id]" and in the
inner "foos[foo[]][bar][#{bar_index}][id]". Submitting of such form leads to an
error like:
>ActionController::BadRequest (Invalid request parameters: expected Array
>(got Rack::QueryParser::Params) for param `foo'):

This commit adds indexes for the foos in the inner blocks, so field names
become "foos[foo][#{foo_index}][bar][#{bar_index}][id]" and submitting of such
form works fine as expected.

Fixes #15332
2015-08-30 20:44:09 +00:00
Lachlan Sylvester
a9c6a583b6 Fix calling cache helper with a relation 2015-08-28 17:26:09 +10:00
Vipul A M
7f23c5d524 - Extracted DELIMITED_REGEX to delimited_regex method and made use of user passed options[:delimited_regex] if available. Changed DELIMITED_REGEX to DEFAULT)DELIMITED_REGEX to signify what it means.
- Added tests for number to delimited and number to currency in both actionview and activesupport.

Changes

Changes
2015-08-28 11:34:17 +05:30
Yves Senn
b8f00b034d Merge pull request #21389 from Gaurav2728/gaurav-unused_require_file
no more require minitest mock here
2015-08-27 13:32:31 +02:00
Aaron Patterson
2ceb16e539 Pull plain content type handling up to render
`render` is the only possible source for the `plain` option.  Pulling
the conditional up to the `render` method removes far away conditionals
2015-08-26 14:04:04 -07:00
Aaron Patterson
fa09bf44db stop passing the options hash to _process_format
We don't need to pass the full hash just to pull one value out.  It's
better to just pass the value that the method needs to know about so
that we can abstract it away from "options"
2015-08-26 13:51:28 -07:00
Gaurav Sharma
aa1f53f3c7 no more require minitest mock 2015-08-27 02:14:30 +05:30
Rafael Mendonça França
518ae9f055 Pass the correct formats 2015-08-24 15:36:14 -03:00
Rafael Mendonça França
face604266 Pass formats to lookup_context
Before we were changing the state of the lookup_context for the duration
of the with_layout_format block, but since we already know the formats
we can just pass it explicitly.

Related with 8d7ce0f22aee09d20091a4dc58cb379a09d13e26
2015-08-24 15:16:59 -03:00
Nick Sutterer
c0daa02c24 remove useless case in #resolve_layout. 2015-08-24 15:07:25 -03:00
Nick Sutterer
8d7ce0f22a remove LookupContext#with_layout_format by passing formats for layouts explicitely. 2015-08-24 15:07:25 -03:00
Ronak Jangir
0a5b08a1e7 Removed Mocha from ActionView part 1 2015-08-24 08:59:19 +05:30
amitkumarsuroliya
bb289b9409 fix Docs [ci skip] 2015-08-18 00:41:17 +05:30
amitkumarsuroliya
f2c04d77ba typo fix [ci skip] 2015-08-18 00:02:16 +05:30