Commit Graph

300 Commits

Author SHA1 Message Date
Vipul A M
8b984161d6
Pass over changelogs [ci skip] 2016-08-10 09:33:13 +05:30
Kasper Timm Hansen
2dc0918718 Move CHANGELOG entry to the top. 2016-08-07 19:14:31 +02:00
Stan Lo
ab2af4dfcb Modify LogSubscriber for single partial's cache message.
Implement naive partial caching mechanism.

Add test for LogSubscriber

Use ActionView::Base#log_payload to store log_subscriber's payload, so we can pass cache result into it.

Fixed tests

Remove useless settings

Check if #log_payload exists before calling it. Because other classes also includes CacheHelper but don't have is attribute

Use @log_payload_for_partial_reder instead of #log_payload to carry ActionView's payload.

Update test's hash syntax

Add configuration to enable/disable fragment caching logging

Remove unless test and add new test to ensure cache info won't effect next rendering's log

Move :enable_fragment_cache_logging config from ActionView to ActionPack

Apply new config to tests

Update actionview's changelog

Update configuration guide

Improve actionview's changelog

Refactor PartialRenderer#render and log tests

Mute subscriber's log instead of disabling instrumentation.

Fix typo, remove useless comment and use new hash syntax

Improve actionpack's log_subscriber test

Fix rebase mistake

Apply new config to all caching intstrument actions
2016-08-08 00:24:39 +08:00
Steven Harman
87899cfcf0 Use to_a to pre-buffer the collection
We can safely assume we're not dealing with an infinite collection as
we're about to call `each` on it and collect the results until it
terminates on its own. Given that, `to_a` is implemented by the normal
Array-like objects, and less Array-like objects like `Enumerator` and
`Enumerator::Lazy`.
2016-07-26 11:33:34 -04:00
Steven Harman
ae75930b59 Fix collection_from_options to allow Enumerators
An optimization was introduced in
27f4ffd11a
which tried to `#to_ary` the collection to prevent unnecessary queries
for ActiveRecord scopes/relations. If the given collection did not
respond to `#to_ary`, and empty collection was returned. That meant you
couldn't use collections built from `Enumerator` nor `Enumerable`.

With this change, `#collection_from_options` will attempt the
optimization, but fall back to passing along the given collection,
as-is.
2016-07-26 10:38:58 -04:00
Marek
a65a3bde0b New syntax for tag helpers i.e. tag.br instead of tag(br) #25195 2016-06-27 19:00:54 +02:00
George Millo
8415996317 English fix
--skip-ci
2016-06-23 14:10:53 +02:00
Rafael Mendonça França
7b0b3d835a
Merge pull request #25469 from herminiotorres/update-datetime-to-datetime-local-by-html-specification
Change datetime to datetime-local helper tag
2016-06-22 13:51:13 -03:00
Herminio Torres
aa6dde37cd
Change datetime to datetime-local helper tag
A change was made in the helper that renders the `datetime`,
being now by default `datetime-local` and creating
an alias of `datetime-local` for `datetime`, `datetime` tag and
it passes to be an abstract class for all other tags that inherit from him.

As a new specification of the HTML 5 the text field type `datetime`
will no longer exist and will pass a `datetime-local`.
Ref: https://html.spec.whatwg.org/multipage/forms.html#local-date-and-time-state-(type=datetime-local)
2016-06-21 22:37:42 -03:00
eileencodes
1de0df8669 Change the raw template handler to render html-safe strings
In PR #24929 the changelog was updated to make note that while the new
template handler was changed to raw this changed the behavior when
outputting plain html or js files. Previously ERB would output the files
unescaped. Changing the default handler to RAW meant that these same
files would be rendered as escaped rather than as js or html.

Because of this change in behavior and after the discussion #24949 in we
decided to change the behavior of the Raw handler to output html_safe
strings by default.

Now files rendered with the default handler (raw) render the file
unescaped.
2016-06-21 17:08:48 -04:00
Jon Moss
ae7b5314f1
Remove space, properly italicize
Difference in rendering --> https://gist.github.com/maclover7/a50ff9231eb825c39c77cd5858af6d9a

[ci skip]
2016-05-21 12:32:55 -04:00
Vipul A M
9bfd968bed
Confirm with the specification when generating emtpy option for select with include_blank: true option.
We now generate option with empty label, example:

`<select id="places" name="places"><option value="" label=" "></option></select>`

 for include_blank: true. This is only done, if content is missing on the option, and we providing the value from this option.

 Fixes #24816
2016-05-21 15:43:35 +08:00
Rafael Mendonça França
8ecc5ab1d8 Start Rails 5.1 development 🎉 2016-05-10 03:46:56 -03:00
Rodrigo Rosenfeld Rosas
c609bb619d Improve AV changelog with regards to default RAW handler
It highlights which kind of incompatibilities this could lead to when rendering plain JS or HTML partials.
2016-05-09 16:40:52 -03:00
Rafael Mendonça França
fbdcf5221a Preparing for 5.0.0.rc1 release 2016-05-06 16:54:40 -05:00
eileencodes
f7a986012a Prep Rails 5 beta 4 2016-04-27 15:48:47 -05:00
Rafael Mendonça França
ff82d7001f Merge pull request #24225 from neumayr/date_select_helper_with_css_classes_accept_hash
date_select helper with_css_classes option also accept a hash
2016-04-20 01:26:11 -03:00
Rafael Mendonça França
6d83ed7129 Add CHANGELOG entry for #23869
[ci skip]
2016-04-20 01:21:31 -03:00
neumayr
d7b6054496 date_select helper with_css_classes option also accept a hash
`date_select` helper `:with_css_classes` option now accepts a hash of strings
for `:year`, `:month`, `:day`, `:hour`, `:minute`, `:second` that will extend
the select type with the given css class value.

```erb
<%= f.date_select :birthday, with_css_classes: { month: "my-month", year: "my-year" } %>
```

```html
<select id="user_birthday_3i" name="user[birthday(3i)]">…</select>
<select id="user_birthday_2i" name="user[birthday(2i)]" class="my-month">…</select>
<select id="user_birthday_1i" name="user[birthday(1i)]" class="my-year">…</select>
```

Optional, add global `html_options` to modify every select tag in the set.

```erb
<%= f.date_select :birthday, with_css_classes: { month: "my-month", year: "my-year" }, { class: "my-date optional" } %>
```

Supported DateHelper methods: `select_day`, `select_month`, `select_year`,
`select_hour`, `select_minute`, `select_second`, `select_datetime`, `select_time`,
`time_select`, `date_select` and `datetime_select`.

`:with_css_classes` option was added to the `date_select` with #7975.
2016-04-05 13:36:17 +02:00
Wojciech Wnętrzak
316811b4d3 Deprecate datetime_field and datetime_field_tag helpers.
Datetime input type was removed from HTML specification.
One can use `datetime_local_field` and `datetime_local_field_tag` instead.
2016-03-31 21:46:12 +02:00
Yves Senn
2346c7f281 guides, sync 5.0 release notes with changelogs
[ci skip]

Sync AV, AR, AJ, AS, AM changelogs with our 5.0 release notes draft.
This is a follow up to c94045d and contains changes made since the
release of beta1.
2016-03-22 14:45:17 +01:00
Jeremy Daer
4f21ac7e9c Fix CHANGELOG spacing [ci skip] 2016-03-02 11:37:19 -07:00
Prem Sichanugrist
82aa20adc0 Add CHANGELOG entry for "Rendering ..." logging 2016-02-26 13:31:56 -05:00
eileencodes
dbfa8fdfc2 Preparing for 5.0.0.beta3 release
Adds changelog headers for beta3 release
2016-02-24 11:14:40 -05:00
Kasper Timm Hansen
355346c196 [ci skip] Move collection caching changelog entry.
We changed this in beta2, and only editing the original entry means
people can't see that it was significantly changed.
2016-02-24 16:20:38 +01:00
Kasper Timm Hansen
e93f0f0f13 [ci skip] Clarify collection caching went EXPLICIT.
Yo dawg, we so explicit if we were a music track, yo' iPhone's Music app would put
an E next to it.

*drops mic*
2016-02-21 16:41:27 +01:00
Prathamesh Sonpatki
37bd077022 Improve CHANGELOG for https://github.com/rails/rails/pull/17043 [ci skip] 2016-02-20 14:43:52 +05:30
James Coleman
459cd7fdd1 Fix button_to's params option to support nested names.
In e6e0579defcfcf94ef1c4c1c7659f374a5335cdb the `params` option was added to the `button_to` helper. However, the patch doesn't support nested hashes so `{a: {b: 'c'}}` for example gets turned into a hidden form input with the name 'a' and the value being the string representation of the `{b: 'c'}` nested hash.

Since Rails supports nested hashes everywhere else (and even in the URL params of link_to and button_to), I believe this to be a bug/unfinished feature.
2016-02-19 11:09:15 -05:00
Ryuta Kamizono
1335959135 Fix grammar a to an [ci skip] 2016-02-13 20:44:44 +09:00
Rafael Mendonça França
60b040e362 Add some Action Cable CHANGELOG entries
And improve changelongs.

[ci skip]
2016-02-01 19:57:50 -02:00
Sean Griffin
49f6ce63f3 Preparing for Rails 5.0.0.beta2 2016-02-01 14:37:52 -07:00
Bart de Water
5e3a23a307 Fix img alt attribute generation when using Sprockets >= 3.0 2016-01-27 19:38:13 +01:00
Rafael Mendonça França
f5065ef60c Merge pull request #20046 from yoongkang/ladida
Use ActiveSupport::SafeBuffer when flushing content_for
2016-01-16 04:23:27 -02:00
Yves Senn
f5ab4055b9 docs, formatting pass over changelogs. [ci skip] 2016-01-13 10:19:55 +01:00
Santiago Pastorino
7e583b73c4 Fix collection_radio_buttons' hidden_field name and make it appear before the radios
Fixes #22773
2015-12-31 00:40:37 -03:00
Justin Coyne
d8e98897b5 TestController#parameters returns AC::Parameters
Fixes #22827
ActionView::TestCase::TestController#parameters should return an
instance of ActionController::Parameters rather than a hash. This
enables helper methods to use the correct interface.
2015-12-29 14:40:17 -06:00
Yves Senn
fefd76e82a Merge pull request #22778 from y-yagi/fix_submit_tag_with_symbol_value
fix TypeError when using submit_tag with Symbol value
2015-12-24 10:20:26 +01:00
Yves Senn
68c5c01db0 release notes, extract notable changes from Action View CHANGELOG.
[ci skip]
2015-12-22 13:26:59 +01:00
Genadi Samokovarov
c5b6ec7b0f No more no changes entries in the CHANGELOGs
During the `5.0.0.beta1` release, the CHANGELOGs got an entry like the
following:

```
* No changes.
```

It is kinda confusing as there are indeed changes after it. Not a
biggie, just a small pass over the CHANGELOGs.

[ci skip]
2015-12-21 11:46:38 +02:00
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
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
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
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
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
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
Vasiliy Ermolovich
c2ad51a2d0 Collection check boxes propagates input's id to the label's for attribute. 2015-10-20 16:39:05 -06:00
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
fc0bbe110e Fix ActionView changelog documentation [ci skip] 2015-10-06 12:45:19 +05:30
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
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
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
Justin Schiff
3822a322a8 Make disable_with default in submit_tag
Prevents double submission by making disable_with the default.

Default disable_with option will only be applied if user has not
specified her/his own disable_with option, whether that is in the
`data-disable-with` string form or the
`:data => { :disable_with => "Saving..." }` hash form. disable_with
will default to the value attribute.

A configuration option was added to opt out of this functionality if
the user so desires.
`config.action_view.automatically_disable_submit_tag = false`
2015-08-11 16:35:10 -07:00
Mauricio Gomez Aguinaga
cf93c6ae48 Sometimes you need a specific break sequence while using word wrap and as today the only option we have is "\n" and is hardcoded.
With this change you will be able to specify any break sequence ("\r\n" for example) as an option.

adding proper documentation for break_sequence in ActionView::Helpers::TextHelper.word_wrap

adding some more documentation for word_wrap custom break sequence and making sure we use new hash syntax
2015-08-11 14:15:47 -07:00
Kasper Timm Hansen
a6509d3112 Add wildcard template dependencies. 2015-07-26 19:21:14 +02:00
Dov Murik
5a41d00455 Support explicit defintion of resouce name for collection caching.
If a template includes `# Template Collection: ...` anywhere in its
source, that name will be used as the cache name for the partial that is
rendered for the collection.

This allows users to enable collection caching even if the template
doesn't start with `<% cache ... do %>`.

Moreover, the `# Template Collection: ...` notation is recognized in all
template types (and template types other than ERB can define a
resource_cache_call_pattern method to allow the `cache ... do` pattern
to be recognized too).
2015-07-07 16:57:09 -04:00
Yves Senn
d4b0e5f59f Merge pull request #20669 from akolomiychuk/image-path
Passing nil to image_tag
2015-06-29 10:52:00 +02:00
Roque Pinel
da1674576d Fix cache issue when different partials use the same collection
Adds the `virtual_path` option to `cache_fragment_name` so it can
be provided when needed.

That allows `cache_collection_render` to get the appropriate cache
key with the digest generated based on the template and prevent
collision with other templates that cache the same collection.
2015-06-28 20:41:59 -05:00
Dov Murik
d51e2eefd5 Improve detection of partial templates eligible for collection caching.
The regular expression which was used to detect partial templates that
begin with a `<% cache ... do %>` call missed some cases.  This commits
attempts to improve the detection for some cases such as multi-line
comments at the beginning of the template.  The different templates are
listed in two new unit test methods.

Note that specially crafted Ruby code can still evade such `cache`-call
detection: for example, a user might have its own method which itself
calls the Rails `cache` helper. In such a case, the template's code
doesn't start with a literal `cache` string and therefore will not be
eligible for collection caching.
2015-06-22 14:17:08 -04:00
Grey Baker
0775407384 Raise an ArgumentError when include_blank is false for a required field in
`Tags::Base#select_content_tag`.

Previously, passing a falsey value to `include_blank` would be ignored if the
field was required, and a blank line would still be inserted. The following will
now raise instead of quietly failing:

`select("post", "category", %w(a required field), { include_blank: false }, required: 'required')`
2015-06-08 16:41:44 +01:00
Yoong Kang Lim
7c988f8030 Use ActiveSupport::SafeBuffer when flushing content_for
Previously, when content_for is flushed, the content
was replaced directly by a new value in
ActionView::OutputFlow#set. The problem is this new
value passed to the method may not be an instance of
ActiveSupport::SafeBuffer.

This change forces the value to be set to a new
instance of ActiveSupport::SafeBuffer.
2015-05-25 22:13:03 +10:00
Prathamesh Sonpatki
daba090dec Pass over CHANGELOGS [ci skip] 2015-05-16 11:00:17 +05:30
Henrik Nygren
bef9484cf8 Do not put partial name to local_assigns when rendering without an object
When one rendered a partial template without specifying an object
or a collection (e.g. <%= render partial: 'partial_name' %>), Rails
would make an object called :partial_name available in local_assigns.
I don't think this was the intended behavior, since no local variable
called 'partial_name' gets defined in the view.
2015-05-14 10:46:44 +03:00
Bernard Potocki
3d8b783d13 Remove :rescue_format option for translate helper since it's no longer supported by I18n. 2015-05-04 23:46:25 +02:00
Bernard Potocki
9c8542bb12 Handle raise flag in translate when both main and default translation is missing. Fixes #19967 2015-05-04 22:26:07 +02:00
Yves Senn
14d0e07026 Revert "Merge pull request #19844 from stevenspiel/link_to_if_block_helper_addition"
This reverts commit d459b001b43d25053e7982e96eb8383538a6e358, reversing
changes made to 4d4950fae9e2a6970b5f1793aadc56a0b44e28a3.

😓

The block is not supposed to be passed to `link_to`. It's used for a
customized behavior of the `condtion = false` case. The docs
illustrate that like so:

```
<%=
   link_to_if(@current_user.nil?, "Login", { controller: "sessions", action: "new" }) do
     link_to(@current_user.login, { controller: "accounts", action: "show", id: @current_user })
   end
%>
```
2015-05-01 11:02:56 +02:00
Yves Senn
d459b001b4 Merge pull request #19844 from stevenspiel/link_to_if_block_helper_addition
Update url_helper.rb
2015-05-01 10:54:23 +02:00
Yves Senn
cdbf685994 pass over CHANGELOGs. [ci skip] 2015-04-22 14:44:30 +02:00
Kevin McPhillips
2b8acdcd21 Override default form builder for a controller 2015-04-13 23:43:34 -04:00
Karol Galanciak
a813fa09a8 Accept lambda as child_index option in #fields_for method 2015-04-05 21:51:19 +02:00
Matthew Draper
07875e2aa6 Merge pull request #19649 from aprescott/allow-array-defaults
Allow an array to be a default translation value.
2015-04-05 02:55:00 +09:30
Adam Prescott
6f3c65f630 Allow an array to be a default translation value.
4.2.1 introduced a change to the way `translate`/`t` works with an
option of `default: [[]]`. In 4.2.0, this would give a default value of
`[]`, but in 4.2.1, it leads to a missing translation.

`default: [[]]` is again allowed for cases where a default of `[]` is
needed.

This addresses GitHub issue 19640.
2015-04-04 12:46:45 -04:00
Rafael Mendonça França
7815fe4634 Merge pull request #19421 from jcoyne/translate_defaults_with_nil
Strip nils out of default translations. Fixes #19419
2015-03-20 18:00:01 -03:00
Yves Senn
8a3bd0899f put the changelog entry in the right file 😓 [ci skip] 2015-03-06 09:12:27 +01:00
Ulisses Almeida
362557eb41 Fix regression when passing a value different of String.
The previous version of rails(4.2.0) you can pass objects
to the default option of translation helper.

For example:

```ruby
  t('foo', default: 1)
```

But on rails 4.2.1 version this kind of use stopped to work,
because started only to accept String types.

Now with this fix we can use orther value types on this
helper again.
2015-02-26 19:04:00 -03:00
Kasper Timm Hansen
0b32beadf5 [ci skip] Add changelog entry for #18948. 2015-02-26 17:23:22 +01:00
Juho Leinonen
4640c346ea Fix dependency tracker bug 2015-02-25 14:57:29 +02:00
Todd Bealmear
01e94ef3b1 Remove RecordTagHelper, add extraction notices
Per DHH in #18337, ActionView::Helpers::RecordTagHelper has been
extracted to an external gem (source currently lives at
todd/record_tag_helper). Removal notices have also been added for anyone
upgrading that use the extracted methods.
2015-02-16 11:35:27 -08:00
Yves Senn
7b75551a1a Merge pull request #18949 from craftsmen/image_tag_size
Allow to pass a string value to size option in `image_tag` and `video_tag`
2015-02-16 13:20:23 +01:00
Mehdi Lahmam
ab5f119ac6 Allow to pass a string value to size option in image_tag and video_tag
This makes the behavior more consistent with `width` or `height` options
2015-02-16 12:58:34 +01:00
Akira Matsuda
da9038eaa5 Partial template name does no more have to be a valid Ruby identifier
because the partial renderer would not create an lvar per each template since c67005f221f102fe2caca231027d9b11cf630484
2015-02-06 01:46:59 +09:00
Daniel Gomez de Souza
6ba4c6d497 Use option url: false to allow entries without a link tag 2015-01-16 16:28:54 -02:00
Prathamesh Sonpatki
6ff026a1cd Fix typo in ActionView CHANGELOG [ci skip] 2015-01-14 16:34:09 +05:30
Rafael Mendonça França
4be859f0fd Change the default template handler from ERB to Raw.
Files without a template handler in their extension will be rended
using the raw handler instead of ERB.
2015-01-04 11:58:42 -03:00
Rafael Mendonça França
34bcbcf357 Remove deprecated AbstractController::Base::parent_prefixes 2015-01-04 11:58:42 -03:00
Robin Dupret
9b9ec0ded4 Fix a few typos [ci skip] 2015-01-03 16:36:33 +01:00
Justin Coyne
fab50c130b Unsafe default translations should not be marked html_safe
Previously default translation keys that didn't end in `_html`, but came
after a missing key that ended in `_html` were being returned as
html_safe. Now they are not. Fixes #18257
2015-01-02 17:07:01 -06:00
Rafael Mendonça França
873870df4c Merge pull request #17974 from killthekitten/fix-render-block
Make possible to use blocks with short version of render partial

Conflicts:
	actionview/CHANGELOG.md
2015-01-02 14:12:23 -03:00
Rafael Mendonça França
c455817804 Merge pull request #17973 from maurogeorge/file_field_hidden_field
Generate a hidden_tag when using a file_field
2015-01-02 13:57:33 -03:00
Mauro George
00b26532f0 Add a hidden_field on the file_field
This will avoid a error be raised when the only input on the form is the
`file_field`.
2015-01-02 12:15:03 -02:00
Robin Dupret
ae08bef428 Changelog edits [ci skip] 2014-12-31 17:35:41 +01:00
Angelo capilleri
c85fed05c5 fix error message of option as with invalid charters in partial rendering
before this PR IDENTIFIER_ERROR_MESSAGE could lead to misunderstand the convention of partial name.
Added OPTION_AS_ERROR_MESSAGE for unvalid charter in as option.
2014-12-29 20:59:57 -03:00
Nikolay Shebanov
f02a35b86e Make possible to use blocks with short version of render partial 2014-12-19 13:52:12 +01:00
Santiago Pastorino
e4627edf87 Revert "Re-enable capture'ing non-String values"
This reverts commit c2fe0938d7201d4ce0bb2f25e72bf5f70df128af.
2014-12-15 21:20:54 -02:00
Carsten Zimmermann
c2fe0938d7 Re-enable capture'ing non-String values
This has been discussed in #17661 and partially reverts the changes made
in 9de83050d3a4b260d4aeb5d09ec4eb64f913ba64 and 986cac73e3c56b3dfa22fd1464f6913e38d32cc3

The test case added to content_for acts as a regression / acceptance test.
2014-12-14 10:57:43 +01:00
Rafael Mendonça França
f25ad07f5a Start Rails 5 development 🎉
We will support only Ruby >= 2.1.

But right now we don't accept pull requests with syntax changes to drop
support to Ruby 1.9.
2014-11-28 15:00:06 -02:00
Agis-
8f7434adba Local vars should exist in partials for falsy :object: values too
c67005f221f102fe2caca231027d9b11cf630484 made the local var in partials
available only if what passed to `:object` was truthy.

For example this would not make the local variable `foo` available inside the
partial:

    render partial: 'foo', object: false

Fixes #17373.
2014-11-25 22:26:42 +02:00
claudiob
b0cc858dd7 Add :enforce_utf8 option to form_for
Since 06388b0 `form_tag` accepts the option `enforce_utf8` which, when set to
false, prevents the hidden "UTF8 enforcer" field from appearing in the output.

This commit implements the same behavior for `form_for`.

Stems from https://github.com/rails/rails/pull/17685#issuecomment-63871395
2014-11-20 12:46:30 -08:00
Akira Matsuda
7839e27b4e Some valid block calls in templates caused syntax errors
Now ActionView accepts <%= foo(){ %> and <%= foo()do %> 
2014-11-20 07:21:50 +09:00
Rafael Mendonça França
450743cf56 Add CHANGELOG entry for #17064 2014-10-25 16:20:44 -07:00
Godfrey Chan
b5571b3ccf Revert "Revert "Merge pull request #16888 from jejacks0n/render_template""
This reverts commit 585e75696b31395aee895e5366e331c07c3f5ee1.
2014-09-26 01:42:18 +09:00
Godfrey Chan
585e75696b Revert "Merge pull request #16888 from jejacks0n/render_template"
This reverts commit 07635a74b5ee08dcba3f6617def6230d8f114fe5, reversing
changes made to 1b5f61a025b6ce1ee52b7148e3ed2a9acbde28b9.

Reason: it's not ready 💣, see https://github.com/rails/rails/pull/16888#issuecomment-56400816
2014-09-23 02:06:08 +09:00
Godfrey Chan
b04ac976d9 CHANGELOG for 07635a7 2014-09-23 00:48:06 +09:00
Akshay Vishnoi
8841f45129 [ci skip] ActionView and ActionMailer CHANGELOG docs fixes 2014-09-18 03:40:51 +05:30
PaoMar
ee61b76a81 Add support for ARIA attributes in tags 2014-09-03 16:14:21 -05:00
Yves Senn
20e7f08ecc minor changelog formatting changes. 2014-08-27 12:09:21 +02:00
Alex Robbin
ce8e4a43b3 provide a builder for form labels to customize wrapping around I18n content 2014-08-20 09:59:28 -04:00
Alex Robbin
8b02832500 add I18n support for :placeholder HTML option is passed to form fields 2014-08-12 23:11:43 -04:00
David Heinemeier Hansson
da1b8a786c Fix that render layout should also be picked up by the template dependency tracker, but only half-ways. You can add that layout option on the same render call, and both templates should be added to the dependency tree. But thats going to require a more serious rework of the tracker. Please do help fix this part of it too. For now, render layout needs to be on its own line. 2014-07-25 16:37:18 -07:00
Rafael Mendonça França
03d77504be Add CHANGELOG entry for PartialIteration.
Closes #7698.
2014-07-16 14:54:23 -03:00
Jolyon Pawlyn
d005777469 Return an absolute instead of relative path from an asset url in the case of the asset_host proc returning nil 2014-07-15 08:32:55 +01:00
Godfrey Chan
00aae7cb38 Synced 4.2 release notes with the latest commits.
Also reordered some of the items to put newer ones on top (same order as
CHANGELOGs), which makes it easier to diff while we are still working on it.
2014-07-11 02:16:57 -07:00
Godfrey Chan
f2fc31473f Add CHANGELOG for c803b90 2014-07-02 15:55:28 -07:00
Rafael Mendonça França
41a7c443a6 Add CHANGELOG entry for #15214
Closes #15214
2014-06-30 17:42:56 -03:00
Lucas Mazza
9f27e1076a 'TextHelper#highlight' now accepts a block to highlight the matched words.
The helper will yield each matched word, and you can use this instead of the
':highlighter' option for more complex replacing logic:

  highlight('My email is me@work.com', EMAIL_REGEXP) { |m| mail_to(m) }
  # => 'My email is <a href="mailto:me@work.com">me@work.com</a>'
2014-06-19 15:22:23 -03:00
Matthew Draper
6857415187 Merge pull request #15654 from pdg137/master
In tag helper, honor html_safe on arrays; also make safe_join more similar to Array.join
2014-06-13 08:52:44 +09:30
Yves Senn
8f247871bb Merge pull request #15590 from zuhao/refactor_actionview_register_template_handler
Add unregister_template_handler to prevent leaks.

Conflicts:
	actionview/CHANGELOG.md
2014-06-12 14:06:59 +02:00
Zuhao Wan
a1dbb4e7e0 Add unregister_template_handler to prevent leaks. 2014-06-12 18:49:40 +08:00
Jiri Pospisil
f62ec6cb2d Fix cache_digest rake tasks
Bring cache_digests:* rake tasks up-to-date with the API changes introduced in
637bb726cac60aaa1f7e482836458aa73e17fbb7
2014-06-10 13:52:36 +02:00
Rafael Mendonça França
3acf28773b Merge pull request #15021 from hubertlepicki/allow_custom_host_in_asset_url
Allow custom asset host to be passed in asset_url
2014-05-16 13:31:20 -03:00
Yves Senn
8109dc8067 formatting pass through CHANGELOGS. [ci skip] 2014-05-16 09:03:26 +02:00
Rafael Mendonça França
05edaa660e Improve CHANGELOG entry 2014-05-14 13:40:54 -03:00
Nick Sutterer
b8ad4b5473 deprecate AbC:Base::parent_prefixes.
rename ::_local_prefixes to ::local_prefixes to state the public attribute.
document the latter.
make ::local_prefixes private, test overriding it and remove documentation for overriding ::_parent_prefixes.
2014-05-13 08:25:24 +10:00
Hubert Łępicki
db9a5c5a1f Improve documentation for asset_url
Updated CHANGELOG.md with entry about :host in asset_url
2014-05-08 20:51:59 +02:00
Joshua Cody
d5f2c5c20e Include label value in i18n attribute lookup
Previously, only the object and method name from the label tag were
used when looking up the translation for a label. If a value is
given for the label, this ought to be additionally used. The
following:

    # form.html.erb
    <%= form_for @post do |f| %>
      <%= f.label :type, value: "long" %>
    <% end %>

    # en.yml
    en:
      activerecord:
        attributes:
          post/long: "Long-form Post"

Used to simply return "long", but now it will return "Long-form
Post".
2014-05-06 14:37:28 -05:00
Robin Dupret
5c87c95a71 Enhance a bit a few changelog entries [ci skip] 2014-05-02 11:56:03 +02:00
phoet
b6aa70c3b5 always use File.join 2014-05-01 16:09:17 -04:00
glorieux
c8b7ad1cc5 Change favicon_link_tag helper mimetype from image/vnd.microsoft.icon to image/x-icon.
Although the official IANA-registered MIME type for ICO files is image/vnd.microsoft.icon,
registered in 2003, it was submitted to IANA by a third party and is not recognized by Microsoft products.
The MIME type image/x-icon should be used since is the one recognized by the major browsers on the market.
2014-04-21 14:28:04 +02:00
Rafael Mendonça França
cbb917455f Merge pull request #14738 from tilsammans/pull/11407
Remove wrapping div with inline styles for hidden form fields.

Conflicts:
	actionview/CHANGELOG.md
2014-04-17 15:29:37 -03:00
Joost Baaij
89ff1f82f0 Remove wrapping div with inline styles for hidden form fields.
We are dropping HTML 4.01 and XHTML strict compliance since input
tags directly inside a form are valid HTML5, and the absense of
inline styles help in validating for Content Security Policy.
2014-04-14 19:45:12 +02:00
Vasiliy Ermolovich
3964bbc490 collection_check_boxes respects :index option for the hidden filed name.
closes #14147
2014-04-14 17:13:43 +03: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
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
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
Godfrey Chan
ecda6dfbdc Added missing changlog entry for #14255 2014-03-04 03:12:30 -08: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
Vladimir Krylov
2cbc8c40b4 Fix ActionView label translation for more than 10 nested elements 2014-02-24 17:06:57 +02: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
Rafael Mendonça França
8b20c72dd8 Preparing for 4.1.0.beta2 release 2014-02-18 15:45:20 -03:00
Prem Sichanugrist
9fe506e394 Add missing CHANGELOG entry to Action View 2014-02-18 12:11:41 -05:00
Xavier Noria
5f295aebdb implements new option :month_format_string for date select helpers [Closes #13618] 2014-02-15 10:27:15 +01:00
Carlos Antonio da Silva
8c7e8b4f18 Minor changelog improvements [ci skip] 2014-01-31 08:02:56 -02:00