Commit Graph

339 Commits

Author SHA1 Message Date
Laura Paredes
95692c6179 Add test for selected and disabled custom attributes in options_for_select 2014-03-31 20:51:13 +02:00
Laura Paredes
be521ef6ac Do not overwrite selected and disabled attributes 2014-03-30 20:23:46 +02:00
Izumi Wong-Horiuchi
60ed9d6282 Fix date_select option overwriting html classes
with_css_classes: true option overwrites other html classes.
Concatenate day month and year classes rather than overwriting.
2014-03-24 20:00:20 -04:00
David Heinemeier Hansson
637bb726ca Digestor should just rely on the finder to know about the format and the variant -- trying to pass it back in makes a mess of things (oh, and doesnt work) 2014-03-21 19:38:59 +01:00
David Heinemeier Hansson
4bca34750d Log the full path, including variant, that the digestor is trying to find 2014-03-21 19:37:34 +01:00
David Heinemeier Hansson
06b4f01fca Fix for digestor to consider variants for partials -- this still needs more testing!! 2014-03-21 19:37:29 +01:00
Arun Agrawal
886fcb0f77 Warning removed (...) interpreted as grouped expression 2014-03-20 21:01:00 +05:30
David Pedersen
4f90298d37 Reorder conditional logic
According to the best practice that "unless not" and "unless else"
is hard to follow logically the link_to_unless and link_to_if
were reversed.
2014-03-18 21:16:36 +01:00
Yves Senn
378c8d2c99 fix number_to_percentage with Float::NAN, Float::INFINITY.
Closes #14405.

This is a follow-up to 9e997e9039435617b6a844158f5437e97f6bc107 to restore
the documented behavior.
2014-03-17 10:55:21 +01:00
Rafael Mendonça França
2d171bdc89 Merge pull request #12662 from nashby/include-hidden-collection
add include_hidden option to collection_check_boxes helper

Conflicts:
	actionview/CHANGELOG.md
	actionview/test/template/form_collections_helper_test.rb
2014-03-15 20:00:50 -03:00
Jeremy Kemper
0da775846a Clarify AV::Digestor.digest method signature docs and deprecation warning 2014-03-15 06:55:14 -07:00
Rafael Mendonça França
d17b87919f Fix the resolver cache and stop mutating the lookup_context
Before we had a bug in the resolver cache so the disable_cache were not
working when passing options to find
2014-03-14 17:32:32 -03:00
Rafael Mendonça França
274d5e45e0 Merge pull request #14329 from pch/digestor-lookup-fix
Ensure LookupContext in Digestor selects correct variant
2014-03-14 14:58:34 -03:00
Łukasz Strzałkowski
2c2326e6ea Introduce #with_formats_and_variants to prevent problems with mutating finder object 2014-03-14 13:41:06 +01:00
Łukasz Strzałkowski
9f677bf043 Add mocked disable_cache for FixtureFinder 2014-03-14 13:18:21 +01:00
Łukasz Strzałkowski
03b8922ee4 Set format in finder 2014-03-14 13:18:21 +01:00
Łukasz Strzałkowski
3b9daf0ff9 Rename _setup_options to _options_for_digest 2014-03-14 13:18:20 +01:00
Łukasz Strzałkowski
4725d58896 Disable LookupContext's cache when looking for template 2014-03-14 13:18:20 +01:00
Łukasz Strzałkowski
48a6baea5e Don't pass hash as keys to #find method 2014-03-14 13:18:20 +01:00
Łukasz Strzałkowski
c63b18de18 Add variants to Template class 2014-03-14 13:18:14 +01:00
Łukasz Strzałkowski
0ca6836a5a Don't create addition vars, use options[] directly 2014-03-13 17:53:23 +01:00
Cakey | Buddy Magsipoc
b87962f3a8 Fix 'fields_for' doc typo. 2014-03-10 20:10:38 +08:00
Kenny Meyer
b5dc91deaa Enhance readability of ActionView DateHelper#distance_of_time_in_words
Refactor numerical constants to module constants which give the numbers
a contextual meaning. This commit aims to provide quicker understanding
for part of the implementation of the
DateHelper#distance_of_time_in_words method.
2014-03-09 21:54:01 -03:00
Piotr Chmolowski
025c691536 Ensure LookupContext in Digestor selects correct variant
Related to: #14242 #14243 14293

Variants passed to LookupContext#find() seem to be ignored, so
I've used the setter instead: `finder.variants = [ variant ]`.

I've also added some more test cases for variants. Hopefully this
time passing tests will mean it actually works.
2014-03-09 08:47:17 +01:00
Vijay Dev
70ff31d69f Merge branch 'master' of github.com:rails/docrails
Conflicts:
	guides/source/4_1_release_notes.md
2014-03-07 20:58:11 +05:30
Aaron Patterson
b7192143ed Merge pull request #14285 from sikachu/master-revert-render-body-remove-content-type
Do note remove `Content-Type` when `render :body`
2014-03-06 08:22:43 -08:00
Hendy Tanata
589d1ed722 Update doc for TagHelper. 2014-03-05 11:54:18 -08:00
Prem Sichanugrist
2dd2fcf896
Introduce Rails.gem_version
This method return `Gem::Version.new(Rails.version)`, suggesting a more
reliable way to perform version comparison.

Example:

    Rails.version #=> "4.1.2"
    Rails.gem_version #=> #<Gem::Version "4.1.2">

    Rails.version > "4.1.10" #=> false
    Rails.gem_version > Gem::Version.new("4.1.10") #=> true
    Gem::Requirement.new("~> 4.1.2") =~ Rails.gem_version #=> true

This was originally introduced as `.version` by @charliesome in #8501
but got reverted in #10002 since it was not backward compatible.

Also, updating template for `rake update_versions`.
2014-03-05 12:37:38 -05:00
Prem Sichanugrist
ed88a601f7
Do note remove Content-Type when render :body
`render :body` should just not set the `Content-Type` header. By
removing the header, it breaks the compatibility with other parts.

After this commit, `render :body` will returns `text/html` content type,
sets by default from `ActionDispatch::Response`, and it will preserve
the overridden content type if you override it.

Fixes #14197, #14238

This partially reverts commit 3047376870d4a7adc7ff15c3cb4852e073c8f1da.
2014-03-05 10:33:52 -05:00
Piotr Chmolowski
1858cc6070 Variants in ActionView::Digestor
Take variants into account when calculating template digests in
ActionView::Digest.

Digestor#digest now takes a hash as an argument to support variants and
allow more flexibility in the future. Old-style arguments have been
deprecated.

Fixes #14242
2014-03-04 15:02:58 +01:00
Carlos Antonio da Silva
7231a135ea Use 1.9 style hash on docs [ci skip] 2014-03-04 08:25:15 -03:00
Carlos Antonio da Silva
8b1ccd5949 Simplify handling of defaults/options in button_tag
There's no need to rely on Active Support's Hash#reverse_merge for
simple cases with default values, since we can just merge from the
default rather than reverse merge from the options.

This also avoids the creation of one extra hash object by moving to a
Hash#merge! call.
2014-03-04 08:23:00 -03:00
Godfrey Chan
ecda6dfbdc Added missing changlog entry for #14255 2014-03-04 03:12:30 -08:00
Sergey Prikhodko
e447ed6902 remove private method and rewrite into more precise notation 2014-03-04 13:18:32 +04:00
Sergey Prikhodko
ca1b98a559 rollback to private method 2014-03-03 18:32:29 +04:00
Sergey Prikhodko
d0d2497c2a cleanup and move extracted method right into the helper 2014-03-03 17:59:57 +04:00
Sergey Prikhodko
ed4fc43287 fix content_or_options to be replaced by options and set to nil 2014-03-03 17:16:28 +04:00
Sergey Prikhodko
28c0177524 fix indentations 2014-03-03 16:42:04 +04:00
Sergey Prikhodko
51ff88cf6a fix form button 2014-03-03 16:33:24 +04:00
Sergey Prikhodko
4a7c8ef793 fix button tag without options 2014-03-03 15:48:48 +04:00
Sergey Prikhodko
aa2101ed33 fix accept nil options 2014-03-03 14:57:41 +04:00
Sergey Prikhodko
60bbbce7a3 fixes default attributes for button_tag 2014-03-03 12:23:51 +04:00
Carlos Antonio da Silva
71b3910a7d Point master changelogs to 4-1-stable branch
Remove 4-1 related entries from master [ci skip]
2014-02-25 09:14:36 -03:00
Matt Campbell
44c5813502 [skip ci] Fix typo in link_to :method option description 2014-02-24 14:17:18 -05:00
Yves Senn
947b3cbaa2 refactor, with_locale is not needed because I18n is mocked.
This is a follow up to #14170. While backporting I recognized
that this call is not needed at all.
2014-02-24 19:31:23 +01:00
Vladimir Krylov
2cbc8c40b4 Fix ActionView label translation for more than 10 nested elements 2014-02-24 17:06:57 +02:00
Yves Senn
3007c297d3 refactor, extract with_locale helper. 2014-02-24 10:28:48 +01:00
Yves Senn
c554d170e6 update version to 4.2.0.alpha 2014-02-23 13:14:43 +01:00
Rafael Mendonça França
33cb47ee48 Use the reference for the mime type to get the format
Before we were calling to_sym in the mime type, even when it is unknown
what can cause denial of service since symbols are not removed by the
garbage collector.

Fixes: CVE-2014-0082
2014-02-18 16:12:51 -03:00
Rafael Mendonça França
1879c259b8 Merge branch '4-1-0-beta2'
Conflicts:
	actionview/CHANGELOG.md
	activerecord/CHANGELOG.md
2014-02-18 16:00:47 -03:00