Commit Graph

874 Commits

Author SHA1 Message Date
Franky W
b1d2635057 Error message testing fix
The testing of error messages have been implemented wrongly a few times.
This is an attempt to fix it.

For example, some of these test should have failed with the new code.
The reason they are not failling with the new string is the fact they
were not being tested beforehand.
2015-02-20 21:23:36 -02:00
Rafael Mendonça França
14a6e17928 Merge pull request #17069 from modosc/master
move cache_digests rake methods into their own namespace
2015-02-20 20:31:48 -02:00
Anthony Dmitriyev
421865e4fd Fix cache_helper comment ERB 2015-02-20 17:04:35 +00:00
Rafael Mendonça França
063b058e28 Merge pull request #17143 from kuldeepaggarwal/fix-mailTo
mail_to helper method fix
2015-02-20 14:58:51 -02:00
Rafael Mendonça França
af5b245065 Use a name that better reflect the return value 2015-02-20 14:24:18 -02:00
Rafael Mendonça França
725d5c85fc Merge pull request #17138 from jpcody/rename_default_form_builder
Rename default_form_builder to avoid collision
2015-02-20 14:23:30 -02:00
Leandro Nunes
8e02dcdf4e Corrects the API to method select_tag
The 'selected' option is not doing what it should do.
The expected behavior is to pass the value selected by default for the options_from_collection_for_select method
2015-02-20 12:01:46 -02:00
Evan Phoenix
e002a68a4e Make the helpers a required argument 2015-02-19 15:11:08 -08:00
Rafael Mendonça França
4ffe46f5fe Merge pull request #18411 from todd/extract_record_tag_helper
Remove RecordTagHelper
2015-02-18 19:19:48 -02:00
Rafael Mendonça França
c407693a41 Add nodoc to private constant [ci skip] 2015-02-18 17:44:57 -02:00
Rafael Mendonça França
3bd7c29ace Merge pull request #18970 from nithinbekal/local-assigns-doc
Add documentation for local_assigns [ci skip]
2015-02-18 17:42:03 -02:00
Rafael Mendonça França
02b955766e Improve documentation of local_assigns 2015-02-18 17:40:58 -02:00
Rafael Mendonça França
e07eb079bf Merge pull request #15700 from maurogeorge/guides-local_assigns
Add docs about local_assigns on guides
2015-02-18 17:34:37 -02:00
Nithin Bekal
3e66017b55 Add documentation for local_assigns [ci skip] 2015-02-17 18:25:59 +05:30
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
Rafael Mendonça França
c3513a13f4 Merge pull request #18845 from bogdan/remove-code-dups-in-action-view
Remove some code duplication in ActionView tags code
2015-02-11 17:40:36 -02:00
Bogdan Gusiev
7543717242 Remove code duplication in ActionView::Helpers::Tags::Base 2015-02-11 14:47:54 +02:00
Yuki Nishijima
6b76c2e280 Remove warning from ActionView::Helpers::Tags::Translator
This removes the following warning:

    /GitHub/rails/actionview/lib/action_view/helpers/tags/translator.rb:19: warning: private attribute?
2015-02-08 16:00:19 -08:00
yuuji.yaginuma
37b36a48b9 use kwargs instead of xhr method. refs #18771. 2015-02-07 09:12:20 +09:00
Miklos Fazekas
be0875f458 Fixed undefined method `i18n_key' for nil:NilClass for labels in non AR form_for
Refactoring at #18647 broke using non active record objects in form_for. This patch
restores the original behaviour where we only compute i18 key when object.respond_to?(:to_model)
2015-02-06 22:44:48 +01:00
Colin Rymer
7fb6759a84 Indicate link_to creates an anchor element
The `link_to` helper generates an HTML anchor element (consisting of opening and closing anchor tags and an element body). The docs currently state the a link tag is generated (which would indicate a tag like `<link>`, which is another valid HTML tag), so this change clarifies that an anchor element is actually generated.

[ci skip]
2015-02-06 12:46:38 -05:00
Rafael Mendonça França
4b4e2281a0 Rename method to make explicit its intention
call is too generic
2015-02-05 16:28:12 -02:00
Rafael Mendonça França
003c0cda26 Use kwags to make the argument meaning explicit 2015-02-05 16:26:16 -02:00
Rafael Mendonça França
d80996ea8d Use new hash syntax 2015-02-05 16:21:39 -02:00
Rafael Mendonça França
44e1cda314 Change the method visibility
Thse methods are used only inside this class
2015-02-05 16:20:39 -02:00
Rafael Mendonça França
0caac9bf9b Add tests to make sure label and placeholder respect to_model 2015-02-05 16:19:29 -02:00
Rafael Mendonça França
79100b8a3a Only check if object respond_to to_model once 2015-02-05 15:28:25 -02:00
Rafael Mendonça França
96be4f65d0 placeholder doesn't exist inside this context 2015-02-05 15:27:27 -02:00
Rafael Mendonça França
ed85348877 Merge pull request #18647 from mcls/placeholderable-to-model
The `model_name` method should be called on `to_model`
2015-02-05 15:16:57 -02: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
Vipul A M
6eced6a1fe Removed magic comments # encoding: utf-8 , since its default from ruby 2.0 onwards. 2015-02-03 20:51:40 +05:30
robertomiranda
ce8efcf296 Use public Module#include, in favor of https://bugs.ruby-lang.org/issues/8846
ref: https://github.com/rails/rails/pull/18763#issuecomment-72349769
2015-01-31 23:12:41 -05:00
Vipul A M
dd6b0c2a3d Fixed test for deprecation warning in actionview, renaming from baf14ae513 2015-01-31 21:54:33 +05:30
yachibit
d8bf32231e Add missing options to datetime_select [ci skip] 2015-01-25 14:30:03 +09:00
Maarten Claes
c946b2a300 Reduce duplication when generating translations 2015-01-22 23:02:48 +01:00
Maarten Claes
ee3dd2f0ff Convert with to_model before calling ActiveModel methods on object 2015-01-22 23:00:34 +01:00
Rafael Mendonça França
e36ecf4d77 Merge pull request #18546 from brainopia/action_view_render
A shortcut to setup controller environment
2015-01-22 12:09:32 -02:00
brainopia
685142e4f4 Support :assigns option when rendering with controllers/mailers. 2015-01-22 00:25:50 +03:00
T.J. Schuck
2a68b470f1 Single instead of double quotes
[ci skip]
2015-01-20 14:21:22 -05:00
T.J. Schuck
d4ec25a317 Rewrite SanitizeHelper docs 2015-01-20 14:19:44 -05:00
T.J. Schuck
4d476ff223 Fix code formatting in sanitize docs 2015-01-20 14:19:44 -05:00
yuuji.yaginuma
5c672c0710 fix typo in number_field_tag documentation [ci skip] 2015-01-19 15:19:44 +09:00
Prathamesh Sonpatki
25991b94c7 Use existing constant for joining instead of '_' 2015-01-18 13:06:42 +05:30
Prathamesh Sonpatki
b417e0b753 nodoc ActionView::ModelNaming module
- Its only used by ActionView internals and not supposed to be used
  through public API.
2015-01-18 11:57:36 +05:30
Yuki Nishijima
08eafc9646 Eliminate a ruby warning in a test in Action View
This eliminates the warning below:

  actionview/test/template/form_helper_test.rb:913: warning: method redefined; discarding old id_came_from_user?
  actionview/test/template/form_helper_test.rb:104: warning: previous definition of id_came_from_user? was here
2015-01-17 09:44:31 -08: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
Sean Griffin
d8e710410e Only use the _before_type_cast in the form when from user input
While we don't want to change the form input when validations fail,
blindly using `_before_type_cast` will cause the input to display the
wrong data for any type which does additional work on database values.
2015-01-14 17:08:25 -07:00
Sean Griffin
b67990cf34 Add tests with an explanation of why we're using _before_type_cast
If you entered incorrect input into a form (particularly with a
numericality validation), we should not replace what you typed in with
`0`, since clicking submit a second time would essentially be the same
as erroneously accepting the junk input as 0.
2015-01-14 16:46:04 -07:00