Commit Graph

1164 Commits

Author SHA1 Message Date
yuuji.yaginuma
767427719e fix typo in config value [ci skip] 2015-12-19 11:39:15 +09:00
eileencodes
099ddfdefd Add CHANGELOG headers for Rails 5.0.0.beta1 2015-12-18 15:58:25 -05:00
Rafael França
cbf827bc9c Merge pull request #22462 from lxsameer/i18n_html_wrap
wrapping i18n missing keys made optional
2015-12-18 18:47:59 -02:00
Sameer Rahmani
c1dbb13eac debug_missing_translation configuration added to action_view
`I18n.translate` helper will wrap the missing translation keys
in a <span> tag only if `debug_missing_translation` configuration has
a truthy value. Default value is `true`. For example in `application.rb`:

    # in order to turn off missing key wrapping
    config.action_view.debug_missing_translation = false
2015-12-18 22:45:05 +03:30
eileencodes
7eae0bb88e Change alpha to beta1 to prep for release of Rails 5
🎉 🍻
2015-12-18 12:14:09 -05:00
Rafael França
b5c13fcdaa Merge pull request #20797 from byroot/prevent-url-for-ac-parameters
Prevent ActionController::Parameters in url_for
2015-12-18 12:47:38 -02:00
Matthew Draper
093b3d6a96 Merge pull request #21914 from zachalewel/zachalewel-patch-1
Update CHANGELOG.md for readability
2015-12-18 14:32:48 +10:30
Akshay Vishnoi
21208d2ab0 Add missing test cases for asset_path 2015-12-17 13:07:10 +05:30
Tony Ta
f7014c5bb6 deletes commented code introduced in db045db (initial commit) 2015-12-15 23:15:57 -08:00
Tony Ta
31497ce7fa deletes commented code introduced in 4673c47d 2015-12-15 22:29:03 -08:00
Jean Boussier
4752e7d837 Prevent ActionController::Parameters from being passed to url_for directly 2015-12-15 13:16:54 +01:00
Sam Stephenson
1a404abc03 Remove ActionView::Helpers::CacheHelper#fragment_cache_key
Introduced in e56c63542780fe2fb804636a875f95cae08ab3f4, `CacheHelper#fragment_cache_key` is a duplicate of `ActionController::Caching::Fragments#fragment_cache_key`.

We now require the view to provide this method on its own (as with `view_cache_dependencies`); `ActionController::Caching::Fragments` exports its version as a `helper_method`.
2015-12-14 17:57:39 -06:00
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
Zach Alewel
9e313db378 Update CHANGELOG.md 2015-10-08 03:24:39 -06:00
Zach Alewel
8e86d161df Update CHANGELOG.md for readability 2015-10-08 03:21:15 -06:00
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