aboutsummaryrefslogtreecommitdiffstats
path: root/actionview
Commit message (Collapse)AuthorAgeFilesLines
...
| * Add tests for render template/partial with variants option.Stan Lo2017-04-143-0/+10
| |
* | Cleanup CHANGELOGs [ci skip]Ryuta Kamizono2017-04-301-1/+2
| | | | | | | | | | | | * Remove trailing spaces. * Add backticks around method and command. * Fix indentation.
* | Merge pull request #20701 from iamvery/date-helper-argument-errorAndrew White2017-04-273-18/+41
|\ \ | | | | | | Ensure input to distance_of_time_in_words is not nil
| * | Ensure input to distance_of_time_in_words is not nilJay Hayes2017-04-273-18/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Internally all input is converted to time so that it can be treated uniformly. Remove now-unneeded condition * Now that all input is treated is converted to time, we no longer need to type check it. Rename variables to clarify their purpose Extract private method to normalize distance_of_time args to time Update actionview changelog
* | | Merge pull request #28844 from ↵Kasper Timm Hansen2017-04-272-1/+3
|\ \ \ | | | | | | | | | | | | | | | | kyuden/remove_unnecessary_attributes_of_select_in_form_with Remove unnecessary `skip_default_ids` and `allow_method_names_outside_object` attributes of select tag in `form_with`
| * | | Remove unnecessary `skip_default_ids` and ↵kyuden2017-04-242-1/+3
| |/ / | | | | | | | | | `allow_method_names_outside_object` attributes of select tag in `form_with`
* | | Merge pull request #28848 from Edouard-chin/ec-remove-unused-methodRafael França2017-04-261-7/+0
|\ \ \ | | | | | | | | `sort_query_string_params` method is no more used
| * | | `sort_query_string_params` method is no more usedEdouard CHIN2017-04-231-7/+0
| |/ / | | | | | | | | | | | | - This method was added in this commit https://github.com/rails/rails/commit/33258d713a4bc20b71e92fd656c923a7b189cd33 - The last caller got removed there https://github.com/rails/rails/commit/0b6ce3422370647cad3e91263a291f69b313d65b
* / / Fix `current_page?` regression:Edouard CHIN2017-04-262-1/+19
|/ / | | | | | | | | | | - `check_parameters` kwargs was added to the `current_page?` method, the implementation was assuming only hashes responds to `delete`. This was causing issues when `current_page?` was called with a Active Model object - ref https://github.com/rails/rails/pull/27549 - Fixes #28846
* | Set to `form_with_generates_remote_forms` only when config is explicitly ↵yuuji.yaginuma2017-04-221-2/+4
| | | | | | | | | | | | | | | | | | specified Without this check, even if config is not specified, `ActionView::Helpers::FormHelper.form_with_generates_remote_forms` always be set to nil and remote form not be generated. Follow up to 128b804c6ce40fcbde744f294f8cb98654f6efec
* | Configure form_with_generates_remote_forms in its own initializerRafael Mendonça França2017-04-212-0/+29
| | | | | | | | | | | | | | | | | | This configuration is not present in ActionView::Base so we can't let the action_view.set_configs initializer set it. Also add tests to make sure this config works. Fixes #28824
* | Fix all style guides violationsRafael Mendonça França2017-04-199-12/+12
| | | | | | | | | | Closes #28382 Closes #28651
* | Reuse the Parameters#to_h check in the routing helpersRafael Mendonça França2017-04-182-6/+5
| | | | | | | | | | Since this protection is now in Parameters we can use it instead of reimplementing again.
* | Add `form_with_generates_remote_forms` config.Kasper Timm Hansen2017-04-161-1/+3
| | | | | | | | | | | | | | Allows users to not have remote forms by default, since there's more JS harness, e.g. bundling rails-ujs, otherwise. Also don't skip creating defaults file anymore. Sprockets isn't the only new config.
* | Default embed_authenticity_token_in_remote_forms to nil.Kasper Timm Hansen2017-04-163-8/+10
| | | | | | | | | | | | | | Effectively treat nil values as "auto", e.g. whatever a form helper chooses to interpret it as. But treat an explicitly assigned false value as disabling.
* | Fix module name [ci skip]yuuji.yaginuma2017-04-151-10/+10
|/ | | | Replace `FormOptionHelper` to `FormOptionsHelper`.
* Merge pull request #28748 from DmytroVasin/rails-ujs-fix-ajax-response-parsingRafael França2017-04-132-3/+31
|\ | | | | Fix mistake in JS response parser
| * Fix mistake in JS response parser:Dmytro Vasin2017-04-132-3/+31
| | | | | | | | | | | | - Restore ability to accept ecmascript JS response should not modify DOM.
* | Close form_for tag in FormHelper API docsAlex Muller2017-04-131-2/+2
|/
* Fix rubocop violationsyuuji.yaginuma2017-04-121-1/+1
|
* Set current page as default for ajax requestsDmytro Vasin2017-04-112-22/+46
|
* Correct typo in component nameAndrew White2017-03-311-1/+1
|
* Reorganize rails-ujs filesJavan Makhmali2017-03-3013-104/+104
|
* Restore rails-ujs.js UMD module supportJavan Makhmali2017-03-301-1/+42
|
* Update comment in sanitizer helper test [skip ci]Ross Kaffenberger2017-03-291-1/+1
| | | The previously referenced file no longer appears to exist in the project.
* Fix link to rails-ujsRyunosuke Sato2017-03-302-2/+2
| | | | | https://github.com/rails/rails-ujs is merged into actionview in favor of https://github.com/rails/rails/pull/28098. [skip ci]
* Merge pull request #28367 from ptoomey3/ignore-disabled-buttonsAaron Patterson2017-03-273-1/+38
|\ | | | | Prevent ujs event propagation if element disabled when event chain begins
| * Prevent event propogation if element is disabled when event chain begins.Patrick Toomey2017-03-093-1/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The existing UJS event behavior relies on browsers not sending events for various events when an element is disabled. For example, imagine the following: <button type="submit" disabled="disabled">Click me</button> The above button is disabled, so browsers will not trigger a click event and all UJS behavior is prevented. However, imagine a button like this: <button type="submit" disabled="disabled"><strong>Click me</strong></button> The above is treated differently by browsers such as Chrome/Safari. These browsers do not consider the strong tag to be disabled, and will trigger click events. UJS has logic to walk up the DOM to find an associated element subject to UJS behavior. But, this logic does not take into account the disabled status of the element. I originally thought we could simply change the selectors used to match elements to ignore disabled elements. However, UJS disables some elements as part of the event chain. So, an element might match early in the chain and then fail to match later. Instead of changing the selectors I added a callback to the chain that calls `stopEverything` if an element is disabled when the event chain begins.
* | Fix `assert_logged` failureRyuta Kamizono2017-03-231-2/+2
| | | | | | | | | | `'#{name}' file doesn't exist, so no dependencies` was removed in bb04814.
* | Stop complaining about not being able to digest dynamic template partial ↵David Heinemeier Hansson2017-03-221-2/+4
| | | | | | | | names and simplify error logging to a single line when not
* | Start Rails 5.2 developmentMatthew Draper2017-03-223-219/+4
| |
* | Merge pull request #28450 from adamgamble/bug_fix/fix_typo_in_actionviewRafael França2017-03-211-1/+1
|\ \ | | | | | | Fix typo in actionview error message in to_form_params helper method
| * | Fix typo in actionview error messageadamgamble2017-03-171-1/+1
| | |
* | | Always use original url_for when generating direct routesAndrew White2017-03-171-0/+46
|/ / | | | | | | | | | | | | Action View overrides `url_for` in the view context to render paths by default when using `url_for` and this means that direct route helpers don't get the full url when called with the url suffix. To fix this always call the original `url_for`.
* | Merge pull request #28407 from claudiob/changelog-skip-pipelineRichard Schneeman2017-03-131-0/+17
|\ \ | | | | | | Add CHANGELOG for #26226 [ci skip]
| * | Add CHANGELOG for #26226 [ci skip]claudiob2017-03-131-0/+17
| |/
* / Small grammar change + new line for "fixes"Jon Moss2017-03-131-2/+4
|/ | | | [ci skip]
* Deprecate implicit coercion of `ActiveSupport::Duration`Andrew White2017-03-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently `ActiveSupport::Duration` implicitly converts to a seconds value when used in a calculation except for the explicit examples of addition and subtraction where the duration is the receiver, e.g: >> 2 * 1.day => 172800 This results in lots of confusion especially when using durations with dates because adding/subtracting a value from a date treats integers as a day and not a second, e.g: >> Date.today => Wed, 01 Mar 2017 >> Date.today + 2 * 1.day => Mon, 10 Apr 2490 To fix this we're implementing `coerce` so that we can provide a deprecation warning with the intent of removing the implicit coercion in Rails 5.2, e.g: >> 2 * 1.day DEPRECATION WARNING: Implicit coercion of ActiveSupport::Duration to a Numeric is deprecated and will raise a TypeError in Rails 5.2. => 172800 In Rails 5.2 it will raise `TypeError`, e.g: >> 2 * 1.day TypeError: ActiveSupport::Duration can't be coerced into Integer This is the same behavior as with other types in Ruby, e.g: >> 2 * "foo" TypeError: String can't be coerced into Integer >> "foo" * 2 => "foofoo" As part of this deprecation add `*` and `/` methods to `AS::Duration` so that calculations that keep the duration as the receiver work correctly whether the final receiver is a `Date` or `Time`, e.g: >> Date.today => Wed, 01 Mar 2017 >> Date.today + 1.day * 2 => Fri, 03 Mar 2017 Fixes #27457.
* Remove `encode_special_chars` option from `strip_tags`Andrew Hood2017-02-273-4/+19
|
* Update package.jsonRafael Mendonça França2017-02-231-1/+1
|
* Preparing for 5.1.0.beta1 releaseRafael Mendonça França2017-02-232-1/+3
|
* Test rails-ujs in our travis matrixRafael Mendonça França2017-02-227-69/+170
|
* Move rails-ujs README and LICENCE to actionviewRafael Mendonça França2017-02-222-0/+69
| | | | We are going to make rails/rails the official repository
* Add custom polymorphic mappingAndrew White2017-02-211-4/+4
| | | | | | | | | | | | | | | | Allow the use of `direct` to specify custom mappings for polymorphic_url, e.g: resource :basket direct(class: "Basket") { [:basket] } This will then generate the following: >> link_to "Basket", @basket => <a href="/basket">Basket</a> More importantly it will generate the correct url when used with `form_for`. Fixes #1769.
* Import rails-ujs v0.1.0 from rails/rails-ujsGuillermo Iguaran2017-02-2011-255/+35
|
* Set correct "routes" in tests casesbogdanvlviv2017-02-202-4/+4
|
* Add assertion to polymorphic_routes_test.rbbogdanvlviv2017-02-201-2/+1
| | | | | | | | | | | | | | | | The assertion will ensure that the behavior doesn't regress. assert_equal "/projects", polymorphic_path("projects") Remove FIXME related to polymorphic_url behavior. polymorphic_url with Symbol or String works equally. Example: default_url_options[:host] = "example.com" polymorphic_url(:projects) # => "http://example.com/projects" polymorphic_url("projects") # => "http://example.com/projects" Related to 37d4415a7b433fcb987b1c6a5b51bf2d8efc5d5e
* Unfreeze interpolated string because it's useless.Stan Lo2017-02-191-1/+1
|
* Add `Style/EmptyLinesAroundMethodBody` in `.rubocop.yml` and remove extra ↵Ryuta Kamizono2017-02-122-2/+0
| | | | empty lines
* Merge pull request #27870 from kenta-s/get-todo-done-in-render_testKasper Timm Hansen2017-02-111-2/+1
|\ | | | | Get TODO done in `render_test`