Commit Graph

1150 Commits

Author SHA1 Message Date
Elektron1c97
6bd417df50 [ci skip] Add a dollar sign to each command in the READMEs
According to pr #22443 in the guides there's always a dollar sign before every command, so why is in the main README a `$` and in every submodule a `%`?

Just eye candy..
2015-12-06 19:18:52 +01:00
Arthur Nogueira Neves
9afb0b9c43 Merge pull request #21241 from pdg137/master
In url_for, never append ? when the query string is empty anyway.
2015-11-26 16:10:46 -05:00
Sean Griffin
e8d73dd18a Merge pull request #17013 from gsamokovarov/fix-null-resolver
Fix improper value types used to instantiate a Template in AV::NullResol...
2015-11-23 14:52:30 -07:00
Kasper Timm Hansen
4547e894e9 Bring back === stubbing in time_zone_select test.
Erroneously removed in 58910dc7.

The stubbing was a regression test to ensure `time_zone_select` wasn't implemented with
`grep`. Rename the test and add a comment to make the intent clearer.
2015-11-22 16:15:46 +01:00
Kasper Timm Hansen
3936f38dae Ditch each_with_index for each.
We never touch the index, so don't bother.
2015-11-22 16:14:37 +01:00
Kasper Timm Hansen
2a8ce91de9 Don't cache fake time zones.
When calling `test_time_zone_select_with_priority_zones_as_regexp` it would
define `=~` on the fake zones, but it would never be cleaned up because of
the zone cache.

Nuke it so `test_time_zone_select_with_priority_zones_as_regexp_using_grep_finds_no_zones`
accidentally find any zones because of `=~` being implemented.
2015-11-22 16:11:28 +01:00
Kasper Timm Hansen
58910dc7b1 Merge pull request #21615 from ronakjangir47/actionViewpart2
Removed Mocha from Action View
2015-11-22 14:19:33 +01:00
Nishant Modak
5d45eed2ab Example of setting data attributes for image_tag 2015-11-20 23:16:53 +05:30
Vijay Dev
153d7ca630 Merge branch 'master' of github.com:rails/docrails 2015-11-15 19:16:58 +00:00
yui-knk
29d0350a2d [ci skip] Use full component name in public API document 2015-11-15 14:00:20 +09:00
Richard Schneeman
c83d1e5508 Merge pull request #22280 from yui-knk/fix_chagnelog_actionview
[ci skip] Fix CHANGELOG.md format from list to italic.
2015-11-12 21:48:21 -06:00
yui-knk
0dc1d8c037 [ci skip] Fix CHANGELOG.md format from list to italic. 2015-11-13 12:43:50 +09:00
yui-knk
429bd260c1 Respect value of :object if :object is false when rendering
This commit fixes the bug convering `false` to `locals[as]` when
`options[:object]` is `false` (close #22260).
2015-11-13 12:26:15 +09:00
Christoph
60dabb156f Fix week_field returning invalid value
According to the W3 spec[1] the value should use a 1-based index
and not a 0-based index for the week number.

[1]: http://www.w3.org/TR/html-markup/datatypes.html#form.data.week
2015-11-10 12:28:47 +00:00
yuuji.yaginuma
69f0b49ca5 fix method name typo [ci skip] 2015-11-09 14:28:28 +09:00
Grzegorz Witek
6b77df0ade Allow host option in javscript and css helpers
Now both `javascript_include_tag` and `stylesheet_tag` can accept `host` option
to provide custom host for the asset
2015-11-08 21:39:39 +08:00
Jerry D'Antonio
23b6f65fd1 Require only necessary concurrent-ruby classes. 2015-11-04 21:12:28 -05:00
Damien Burke
ab5fb4f224 Don’t allow arbitrary data in back urls
`link_to :back` creates a link to whatever was
passed in via the referer header. If an attacker
can alter the referer header, that would create
a cross-site scripting vulnerability on every
page that uses `link_to :back`

This commit restricts the back URL to valid
non-javascript URLs.

https://github.com/rails/rails/issues/14444
2015-11-03 17:20:48 -08:00
Rafael Mendonça França
e37b470a66 Add tests to make sure mail_to work with nil and SafeBuffer 2015-11-03 17:43:30 -02:00
Yuki Nishijima
266455cf25 Deprecate exception#original_exception in favor of exception#cause 2015-11-03 06:54:34 -08:00
Paul Grayson
e6e056c2c1 In url_for, never append ? when the query string is empty anyway.
It used to behave like this:

    url_for(controller: 'x', action: 'y', q: {})
    # -> "/x/y?"

We previously avoided empty query strings in most cases by removing
nil values, then checking whether params was empty.  But as you can
see above, even non-empty params can yield an empty query string.  So
I changed the code to just directly check whether the query string
ended up empty.

(To make everything more consistent, the "removing nil values"
functionality should probably move to ActionPack's Hash#to_query, the
place where empty hashes and arrays get removed.  However, this would
change a lot more behavior.)
2015-10-29 17:02:13 -07:00
Sean Griffin
f2ae4af9e1 Fix style issues with #16252 2015-10-29 11:15:19 -06:00
Lecky Lao
462698b2c7 making selected value to accept Hash like the default option. E.g. selected: {day: params[:day].to_i, month: params[:month].to_id}
Adds in test test_date_select_with_selected_in_hash and change log

fixes typo in CHANGELOG
2015-10-29 11:02:31 -06:00
Yves Senn
ec94f00ba3 Merge pull request #22116 from gsamokovarov/fix-form-for-block-test
Fix a faulty form_for test
2015-10-29 16:22:47 +01:00
Genadi Samokovarov
252660b886 Fix a faulty form_for test
Stumbled upon this one while trying to deprecate the String/Symbol
passing to `form_for`.

This test passed on an accident, because the signature of `form_for`
currently accepts 2 positional arguments and a block. Calling it with
the wrong number of arguments caused:

```ruby
(byebug) form_for(:post, @post, html: { id: 'create-post' })
*** ArgumentError Exception: wrong number of arguments (3 for 1..2)
```

This made the test pass, because it was still an `ArgumentError`. :-)
2015-10-29 16:38:25 +02:00
Kasper Timm Hansen
0fb2d1a0ba Ignore scope in missing translation input.
It's already represented in the key name. Demonstrate with a test.

Also test that the default isn't output.
2015-10-28 21:52:33 +01:00
Sebastian McKenzie
a97dcde689 Tweaked wording used in some tests. 2015-10-25 08:57:50 +00:00
Vasiliy Ermolovich
c2ad51a2d0 Collection check boxes propagates input's id to the label's for attribute. 2015-10-20 16:39:05 -06:00
yui-knk
1099329be0 Delete needless require 'active_support/deprecation'
When `require 'active_support/rails'`, 'active_support/deprecation'
is automatically loaded.
2015-10-20 20:02:59 +09:00
Rafael Mendonça França
a7bd1c7c88 Merge pull request #21894 from abhishekjain16/refactor_with_dry
Follow DRY principle and remove duplication
2015-10-08 14:16:46 -03:00
Abhishek Jain
9a57e7f9bb Follow DRY principle and remove duplication 2015-10-08 22:33:55 +05:30
Abhishek Jain
fc4fbac073 [ci skip] fix typo 2015-10-07 15:10:33 +05:30
Jeremy Daer
565094a8b5 Use Mime[:foo] instead of Mime::Type[:FOO] for back compat
Rails 4.x and earlier didn't support `Mime::Type[:FOO]`, so libraries
that support multiple Rails versions would've had to feature-detect
whether to use `Mime::Type[:FOO]` or `Mime::FOO`.

`Mime[:foo]` has been around for ages to look up registered MIME types
by symbol / extension, though, so libraries and plugins can safely
switch to that without breaking backward- or forward-compatibility.

Note: `Mime::ALL` isn't a real MIME type and isn't registered for lookup
by type or extension, so it's not available as `Mime[:all]`. We use it
internally as a wildcard for `respond_to` negotiation. If you use this
internal constant, continue to reference it with `Mime::ALL`.

Ref. efc6dd550ee49e7e443f9d72785caa0f240def53
2015-10-06 11:29:30 -07:00
Kasper Timm Hansen
5b69e30622 Merge pull request #21887 from abhishekjain16/doc_fix
Fix usage of word alternatively in docs [ci skip]
2015-10-06 20:21:00 +02:00
tanmay3011
148d1217a1 [ci skip] Change 'an URL' to 'a URL' as URL doesn't have a vowel sound 2015-10-06 23:34:05 +05:30
Abhishek Jain
fe33c15d4d Fix usage of word alternatively in docs [ci skip] 2015-10-06 23:20:27 +05:30
Abhishek Jain
fc0bbe110e Fix ActionView changelog documentation [ci skip] 2015-10-06 12:45:19 +05:30
Aaron Patterson
4ddbd437c6 render should return a string 2015-10-05 17:33:59 -07:00
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