Commit Graph

817 Commits

Author SHA1 Message Date
Kuldeep Aggarwal
90aef23e38 No need of requiring rbconfig, it is by-default loaded 2015-01-10 20:27:18 +05:30
Rafael Mendonça França
1c8192669f Avoid changing the global state on the tests 2015-01-05 14:39:52 -03:00
Rafael Mendonça França
d76bf34b04 Merge pull request #17676 from tigrish/fix_custom_i18n_exception_handler_regression
Fix I18n regression introduced by #13832
2015-01-05 14:35:50 -03:00
Rafael Mendonça França
9644cdcd3d Merge pull request #18328 from brainopia/remove_tz_proxy
Use directly TZInfo::Timezone without proxy
2015-01-04 18:42:40 -03:00
Rafael Mendonça França
2bf8b5b6ec Remove wrong TODO comment 2015-01-04 15:54:22 -03:00
Rafael Mendonça França
dc7ed96adc Remove version conditional for find_template_paths
Now that we only support Ruby 2.2+ we don't need this conditional
anymore
2015-01-04 15:54:21 -03:00
brainopia
ab4c900656 Use directly TZInfo::Timezone without proxy
Since real timezone is loaded anyway in `#utc_offset`
which is called during `#create`
2015-01-04 20:08:18 +03:00
claudiob
adfeeb01e7 Remove unneeded require 'as/deprecation'
Tests should still pass after removing `require 'active_support/deprecation'`
from these files since the related deprecations have been removed.
2015-01-04 07:45:07 -08:00
Rafael Mendonça França
bf7b8c193f Remove unneeded requires
These requires were added only to change deprecation message
2015-01-04 12:11:03 -03:00
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
Vijay Dev
4b9dba99d6 Merge branch 'master' of github.com:rails/docrails 2015-01-03 14:58:17 +00: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
Robin Dupret
843fc99786 Follow up to #17973 [ci skip] 2015-01-02 20:26:39 +01: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
24637e577c Merge pull request #18271 from arunagw/change-copyright-year
Update copyright notices to 2015 [ci skip]
2015-01-01 00:08:17 +01:00
Robin Dupret
ae08bef428 Changelog edits [ci skip] 2014-12-31 17:35:41 +01:00
Arun Agrawal
4de18d0ead Update copyright notices to 2015 [ci skip] 2014-12-31 08:34:14 +01:00
Ben Woodall
7b4c6dca43 Fixes simple missprint in docs for #cyle in text_helper 2014-12-30 12:09:47 -08:00
Robin Dupret
20ea1a2adf Tiny documentation fixes [ci skip] 2014-12-30 17:00:40 +01:00
Robin Dupret
0c937b6d1e Merge pull request #18130 from claudiob/better-record-identifier-doc
Better docs for AV::RecordIdentifier [ci skip]
2014-12-30 16:55:16 +01:00
Rafael Mendonça França
0c070ae568 Merge pull request #18251 from tjgrathwell/fix-polymorphic-routes-to-model
Fix form_for to work with objects that implement to_model
2014-12-30 11:23:47 -03:00
Rafael Mendonça França
ecb1981bfd Template lookup now respect default locale and I18n fallbacks.
Given the following templates:

    mailer/demo.html.erb
    mailer/demo.en.html.erb
    mailer/demo.pt.html.erb

Before this change for a locale that doesn't have its related file
the `mailer/demo.html.erb` will
be rendered even if `en` is the default locale.

Now `mailer/demo.en.html.erb` has precedence over the file without
 locale.

Also, it is possible to give a fallback.

    mailer/demo.pt.html.erb
    mailer/demo.pt-BR.html.erb

So if the locale is `pt-PT`, `mailer/demo.pt.html.erb` will be
 rendered given the right I18n fallback configuration.

Fixes #11884.
2014-12-29 23:48:35 -03:00
Travis Grathwell
3efd90ac5b Fix form_for to work with objects that implement to_model
Previously, if you tried to use form_for with a presenter object
that implements to_model, it would crash in
action_dispatch/routing/polymorphic_routes.rb when asking the presenter
whether it is .persisted?

Now, we always ask .persisted? of the to_model object instead.

This seems to been an issue since 1606fc9d840da869a60213bc889da6fcf1fdc431

Signed-off-by: Eugenia Dellapenna <eugenia.dellapenna@gmail.com>
2014-12-29 18:12:03 -08: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
claudiob
d3b098b828 Require Ruby 2.2 for Rails 5.0
Stems from [this comment](https://github.com/rails/rails/pull/18203#issuecomment-68138096) by @robin850
and by the blog post http://weblog.rubyonrails.org/2014/12/19/Rails-4-2-final
2014-12-26 13:53:09 +01:00
claudiob
8a950a5038 Fix "Rendering" not to link to AV::Rendering
The "Rendering" word in the titles is not meant to be a link to
the documentation for ActionView::Rendering.

[ci skip]
2014-12-25 02:12:52 +01:00
Sean Griffin
dbdb104076 Merge pull request #18107 from mkdynamic/add-reply-to-mail-to
Add support for Reply-To field in mail_to helper
2014-12-24 07:10:53 -07:00
Sean Griffin
21289bed3b Merge pull request #18166 from merongivian/search_field_refactor
Remove block from super
2014-12-23 08:37:17 -07:00
Jose Añasco
96f0aad6ec Remove block from super 2014-12-23 09:38:44 -05:00
claudiob
943ebcb5f1 Better docs for AV::RecordIdentifier
This commit intends to clarify the scope of ActionView::RecordIdentifier
methods `dom_id` and `dom_class`.

Most of the current documentation comes from da257eb8 (7 years ago) when
the decoupling of ActionView, ActiveRecord and ActiveModel was not a concern.

Since then, steps have been taken to reach such decoupling, especially
8ca17926 which duplicated ActionController::ModelNaming into
ActionView::ModelNaming explaining that:

> These are just a simple helpers for decoupling Active Model, so it does not
> make sense to extract it to Active Support, but the point is to decouple also
> Action View and Action Pack

As of today, ActionView::RecordIdentifier only includes `dom_id` and `dom_class`
so it makes sense to explicitly document those two methods, and leaving the
details of helpers like `div_for` in the corresponding files.

Moreover, I think it's important to mention in the documentation that
ActionView::RecordIdentifier **does not strictly depend on the ActiveRecord API**: any class `Post` implementing `post.to_key` and `post.model_name.param_key` will work.

[ci skip]
2014-12-23 02:01:53 +01:00
claudiob
b26338e83b Better tests for AV::RecordIdentifier
This commit intends to clarify the scope of ActionView::RecordIdentifier
methods `dom_id` and `dom_class`.

Most of the current documentation comes from da257eb8 (7 years ago) when
the decoupling of ActionView, ActiveRecord and ActiveModel was not a concern.

Since then, steps have been taken to reach such decoupling.
Therefore I think it's important to show that ActionView::RecordIdentifier
**does not strictly depend on the ActiveRecord API**:
any class `Post` implementing `post.to_key` and `post.model_name.param_key`
will work.

This commit adds a test to prove that ActionView::RecordIdentifier methods
can also be used on objects that do not subclass ActiveRecord::Base.
2014-12-23 01:59:25 +01:00
claudiob
7375c17114 Remove unused Sheep fixture from AV
The `Sheep` fixture was added in eb23754e when moving template tests
from actionpack to actionview, but it's not actually used in ActionView tests.

The `Sheep` fixture is only used to test `uncountable` in ActiveModel tests,
and is already defined in activemodel/test/models/sheep.rb
2014-12-22 04:02:35 +01:00
Mark Dodwell
fecbed6fb1 Add support for Reply-To field in mail_to helper 2014-12-20 15:50:09 -08:00
Nikolay Shebanov
f02a35b86e Make possible to use blocks with short version of render partial 2014-12-19 13:52:12 +01:00
yui-knk
609d3a8475 [ci skip] Fix HTML format on comment 2014-12-18 13:07:32 +09:00
Jon Atack
2038c2c53d Test to ensure content_tag works when fixing #17661
After c2fe093, which was reverted yesterday, there will likely be
future PRs to address #17661.

The test `actionview/test/template/capture_helper_test.rb
#test_capture_returns_nil_if_the_returned_value_is_not_a_string` should
have errored with c2fe093, but it was rewritten in the PR to not raise.
My guess is that it may have seemed irrelevant to the content_tag tests
or already covered by them.

This test provides additional protection by being in the content_tag
test suite to explicitly raise a red flag in future cases. It foregoes
some redundancy for safety — at least until #17661 is closed.
2014-12-16 17:37:26 +01:00
Santiago Pastorino
ecb26b736e Regression test for #18024 2014-12-15 21:34:15 -02: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
Jose Añasco
112274ebff Fix options overwritten by super 2014-12-09 09:33:03 -05:00
Yves Senn
66966f2d61 Merge pull request #17878 from claudiob/remove-unused-modgreet-fixture
Remove unused AV/test/fixtures/scope
2014-12-02 10:32:21 +01:00
claudiob
e6487c7eef Remove unused AV/test/fixtures/scope
The file `modgreet.erb` was added 8 years ago in 21187c0
and is not used anymore by any test.
2014-12-01 23:24:14 -08:00
claudiob
78145f1005 Remove unused AV/test/fixtures/happy_path
The `test/fixtures/happy_path/render_action/hello_world.erb` file was
introduced in 8ab37c7 for the `TestRenderAction` test.

That test was subsequently removed in 34f058e, so the fixture is not
used anymore.

If Travis CI is happy, then you can be sure the fixture can be removed.
2014-12-01 23:22:51 -08:00
Santiago Pastorino
72f4c7af10 Merge pull request #17871 from claudiob/remove-unused-blog-public-fixtures
Remove unused AV/test/fixtures/blog_public
2014-12-02 02:28:08 -02:00
Santiago Pastorino
64d90c470b Merge pull request #17872 from claudiob/remove-duplicate-functional-caching-fixture
Remove one AV fixture (duplicate of an AP fixture)
2014-12-02 02:27:55 -02:00
Santiago Pastorino
cd77755ae4 Merge pull request #17866 from bogdan/default-form-builder
Bugfix config.action_view.default_form_builder option
2014-12-01 18:01:49 -02:00