Commit Graph

300 Commits

Author SHA1 Message Date
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
Yves Senn
02f9f33142 tidy CHANGELOGs [ci skip] 2014-01-30 11:12:46 +01:00
Kassio Borges
433628a45c Rails config for raise on missing translations
Add a config to setup whether raise exception for missing translation or
not.
2014-01-27 08:03:46 -02:00
João Britto
e987dcd78f Update changelog 2014-01-09 20:47:14 -02:00
Gaelian Ditchburn
7a085dac2a Switched to use display:none in extra_tags_for_form method.
The use of `display:inline` with the content_tag call in the
extra_tags_for_form method potentially causes display issues with some
browsers, namely Internet Explorer. IE's behaviour of not collapsing
the line height on divs with ostensibly no content means that the
automatically added div containing the hidden authenticity_token, utf8
and _method form input tags may interfere with other visible form
elements in certain circumstances. The use of `display:none` rather
than `display:inline` fixes this problem.

Fixes #6403
2014-01-05 17:16:22 +00:00
Robin Dupret
2bc88d4f74 Add a changelog entry for #13363 [ci skip] 2013-12-21 14:03:14 +01:00
Rafael Mendonça França
a220b1518d Merge pull request #13059 from imkmf/cycle-accepts-array
Cycle object should accept an array

Conflicts:
	actionview/CHANGELOG.md
2013-12-06 17:05:59 -02:00
Kristian Freeman
1eaa521273 A Cycle object should accept an array and cycle through it as it would
with a set of comma-separated objects.
2013-12-06 10:57:37 -08:00
Andriel Nuernberg
ec19c77ca5 Label only accepts :index and :namespace attributes from the input 2013-12-05 20:27:38 -02:00
Godfrey Chan
2c564cdbdb Added \u2028 \u2029 to json_escape 2013-12-04 09:43:42 -08:00
Godfrey Chan
2f1c5789c1 Fixed a long-standing bug in json_escape that strips quotation marks 2013-12-04 09:27:54 -08:00
Yves Senn
543ccf740d ActionView::MissingTemplate for partials includes underscore.
Missing partial folder/_partial instead of folder/partial.

Closes #13002.
2013-12-02 08:35:34 +01:00
Shimpei Makimoto
1e848906c5 Use set_backtrace instead of @backtrace in ActionView error 2013-11-16 04:41:28 +09:00
Carlos Antonio da Silva
5deec016fe Improve changelogs formatting [ci skip] 2013-11-09 16:44:58 -02:00
pseidemann
881a2cc907 fix simple_format escapes own output when sanitize is set to true 2013-11-08 17:13:59 +01:00
Jérémy Lecour
cdf74eb5a0 Fix typo in the CHANGELOG 2013-10-31 15:29:16 +01:00
Vasiliy Ermolovich
106c988c10 add include_hidden option to collection_check_boxes helper 2013-10-27 18:31:19 +03:00
Brad Murray
6c04cb2261 update changelog 2013-10-15 11:23:37 +13:00
Rafael Mendonça França
0cc4ff77cc Add CHANGELOG entry for #12344
[ci skip]
2013-09-24 21:07:24 -03:00
Bogdan Gusiev
e8e08d69c2 Fix some edge cases for AV select helper with :selected option 2013-09-23 17:48:23 +03:00
Rafael Mendonça França
0e9f0bd6f7 Use ERB in the CHANGELOG [ci skip] 2013-09-23 11:11:26 -03:00
Bogdan Gusiev
57bf92c6de Ability to pass block to AV#select helper
Example:

    = select(report, "campaign_ids") do
      - available_campaigns.each do |c|
        %option{:data => {:tags => c.tags.to_json}, :value => c.id}= c.name
2013-09-23 14:25:42 +03:00
Vasiliy Ermolovich
0b0ac5d917 handle :namespace form option in collection labels 2013-09-22 21:49:01 +03:00
Daniel Schierbeck
77e79ecd92 Bust the template digest cache key when details are changed
Since the lookup details will influence which template is resolved, they
need to be included in the cache key -- otherwise two different
templates may erroneously share the same digest value.
2013-09-19 10:25:14 +02:00
Rafael Mendonça França
495daef061 Merge pull request #12112 from adamniedzielski/fix-form-for-namespace-and-as
form_for - fix :namespace and :as options clash

Conflicts:
	actionview/CHANGELOG.md
2013-09-12 18:20:14 -03:00
Rafael Mendonça França
4bdf929579 Write the right CHANGELOG entry for #11603
[ci skip]
2013-09-12 13:25:21 -03:00
Adam Niedzielski
e18f045b65 form_for - fix :namespace and :as options clash
:as option should not overwrite :namespace option when
generating html id attribute of the form element. id should be prefixed
by specified namespace even if :as option is present

Add test case showing the issue and code fixing it
2013-09-09 07:59:07 +02:00
Paul Nikitochkin
061e48df26 Cleanup of excerpt helper
* replaced String concatenation by joining
* separator has default value to '', even it is nil
2013-09-06 18:00:55 +03:00
Rafael Mendonça França
974335d4d0 Improve CHANGELOG entry [ci skip] 2013-08-27 14:10:45 -03:00
Josh Lauer
7e74a01f84 Only cache template digests if config.cache_template_loading
since ActionView::Resolver.caching is set to the same value as config.cache_template_loading
only cache template digests if config.cache_template_loading is not falsy
fixes issues #10752 and #10791
2013-08-06 14:06:42 -04:00
Nathan Stitt
0855f041df Add "extname" option to javascript_include_tag
ActionView::Helpers.asset_path is where the logic for
javascript_include_tag resides.  It takes an extname option for
specifying the extension or false to not append it.  This exposes that
option to javascript_include_tag.

Without the option files that didn't end with ".js" would get the
extension appended to them.  This broke JST templates and other file
types that should be interpreted as JavaScript but who's file extension
isn't ".js"
2013-08-03 09:30:06 -05:00
Rajarshi Das
36aaf46372 fix the changelog typo[ci skip] 2013-08-02 12:33:35 +05:30
Rafael Mendonça França
69339e54d3 Fix current_page? when the URL contains escaped characters
In some cases webservers like nginx send the escaped characters
lowercased to the Rails application. The current_page? helper was
comparing the escaped strings that are different since Ruby escapes the
URL using uppercased characters.
2013-08-01 10:46:35 -03:00
Joel Cogen
1424873948 text_area should handle nil value option like text_field 2013-07-24 08:39:17 +02:00
Carlos Antonio da Silva
c23c193a84 Fix changelog syntax and use Ruby 1.9 hash style [ci skip] 2013-07-22 14:36:09 -03:00
Vasiliy Ermolovich
cadfe4bf45 add support for html attributes to grouped_options_for_select 2013-07-20 17:14:28 +03:00
Rafael Mendonça França
ebc5bdb8e7 Use the canonical router on the CHANGELOG entry
Thanks @egilburg

[ci skip]
2013-07-18 10:35:15 -03:00
kennyj
ca85caca0d Fix default rendered format problem when calling render method without :content_type option. Closes #11393. 2013-07-15 02:11:43 +09:00
Rafael Mendonça França
b18a27375a Add CHANGELOG entry for #11348 2013-07-07 14:26:20 -03:00
Rafael Mendonça França
09f6fe1cd4 Fix "Stack Level Too Deep" error when rendering recursive partials
When rendering recursive partial Action View is trying to generate the
view digest infinitly causing a stack level error.

Fixes #11340
2013-07-07 13:44:16 -03:00
Takayuki Matsubara
06388b0779 Added an enforce_utf8 hash option for form_tag method
Control to output a hidden input tag with name `utf8` without monkey
patching

Before:

    form_tag
    # => '<form>..<input name="utf8" type="hidden" value="&#x2713;" />..</form>'

After:

    form_tag
    # => '<form>..<input name="utf8" type="hidden" value="&#x2713;" />..</form>'

    form_tag({}, { :enforce_utf8 => false })
    # => '<form>....</form>'
2013-07-07 23:49:38 +09:00
Carlos Antonio da Silva
6b9356a4b7 Remove the deprecated include_seconds argument from distance_of_time_in_words
Pass in an :include_seconds hash option to use this feature.
2013-07-02 22:46:23 -03:00
Vipul A M
38aafc0377 Remove FormBuilder deprecation warning about block argument and associated tests 2013-07-02 02:06:39 +05:30
Jon Rowe
53eb9fdd9c fetch value(s) from stringified options 2013-06-29 19:32:13 +10:00
Carlos Antonio da Silva
e16ad2db8c Review AV changelog [ci skip] 2013-06-27 15:39:17 -03:00
kennyj
94c72c45bb Remove passing the prompt to grouped_options_for_select as an argument, because it was deprecated. 2013-06-28 03:11:00 +09:00
Rafael Mendonça França
035e2976d0 Add CHANGELOG entry for #10971
[ci skip]

Conflicts:
	actionpack/CHANGELOG.md
2013-06-24 16:21:54 -03:00
Łukasz Strzałkowski
d1fb5d5949 Adjust changelog for AV & AP 2013-06-20 19:06:52 +02:00
Łukasz Strzałkowski
1d59e94cea Remove heading from AV's CHANGELOG 2013-06-20 19:01:26 +02:00
Piotr Sarnacki
5bcdf4faa6 ActionView version should be 4.1.0 2013-06-20 17:23:15 +02:00
Piotr Sarnacki
78b0934dd1 Add bare actionview gem to the root directory
This commit creates structure for Action View gem and is first of a
series of commits extracting Action View from Action Pack.
2013-06-20 17:23:15 +02:00