aboutsummaryrefslogtreecommitdiffstats
path: root/actionview/lib/action_view/routing_url_for.rb
Commit message (Collapse)AuthorAgeFilesLines
* respect path_only option when an array is passed into url_forJoel Ambass2018-10-011-11/+12
| | | | | | | | The url_for method is now extracting the path_only option in order to determine if polymorphic_path or polymorphic_url should be called. If the path_only option is not set it will be set to true unless the host option is set. This behaviour is the same as when a Hash or Params object is passed. To support this unifying the code responsible for setting this default value has been extracted into a private method
* Use frozen string literal in actionview/Kir Shatrov2017-07-241-0/+2
|
* Revert "Merge pull request #29540 from kirs/rubocop-frozen-string"Matthew Draper2017-07-021-1/+0
| | | | | This reverts commit 3420a14590c0e6915d8b6c242887f74adb4120f9, reversing changes made to afb66a5a598ce4ac74ad84b125a5abf046dcf5aa.
* Enforce frozen string in RubocopKir Shatrov2017-07-011-0/+1
|
* Fix Rubocop violations and fix documentation visibilityRafael Mendonça França2016-12-281-7/+7
| | | | | | Some methods were added to public API in 5b14129d8d4ad302b4e11df6bd5c7891b75f393c and they should be not part of the public API.
* Privatize unneededly protected methods in Action ViewAkira Matsuda2016-12-241-6/+3
|
* applies remaining conventions across the projectXavier Noria2016-08-061-1/+0
|
* applies new string literal convention in actionview/libXavier Noria2016-08-061-1/+1
| | | | | The current code base is not uniform. After some discussion, we have chosen to go with double quotes by default.
* Merge pull request #21894 from abhishekjain16/refactor_with_dryRafael Mendonça França2015-10-081-10/+6
|\ | | | | Follow DRY principle and remove duplication
| * Follow DRY principle and remove duplicationAbhishek Jain2015-10-081-10/+6
| |
* | [ci skip] fix typoAbhishek Jain2015-10-071-1/+1
|/
* `url_for` does not modify polymorphic optionsBernerd Schaefer2015-09-041-2/+3
| | | | | | | | | | | | | | | | | 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
* Make AC::Parameters not inherited from HashPrem Sichanugrist2015-07-151-0/+10
| | | | | | | | This is another take at #14384 as we decided to wait until `master` is targeting Rails 5.0. This commit is implementation-complete, as it guarantees that all the public methods on the hash-inherited Parameters are still working (based on test case). We can decide to follow-up later if we want to remove some methods out from Parameters.
* move _generate_paths_by_default to where it is usedAaron Patterson2015-03-011-0/+6
| | | | | _generate_paths_by_default wasn't used in AD::Routing::UrlFor, so we should be able to move it where it is used in AV::Routing
* let mailer templates generate URLs by default [Xavier Noria, Richard Schneeman]Xavier Noria2014-11-241-8/+25
|
* Perf optimization for `url_for` called w/ Hashschneems2014-08-141-1/+3
| | | | | | | | | | | | | | | | | | | | | Benchmarking the existing code: ```ruby { :only_path => options[:host].nil? }.merge!(options.symbolize_keys)) ``` Against optimized code, that does not require a new hash or a merge: ```ruby options = options.symbolize_keys options[:only_path] = options[:host].nil? unless options.key?(:only_path) options ``` We see a statistically significant performance gain: ![](https://www.dropbox.com/s/onocpc0zfw4kjxl/Screenshot%202014-08-14%2012.45.30.png?dl=1) Updated to not mutate incoming parameters
* use the helper method builder to construct helper methodsAaron Patterson2014-05-121-2/+6
|
* probably should not check in a raiseAaron Patterson2014-05-121-1/+0
|
* undo optimized calls until the builder object is finishedAaron Patterson2014-05-121-4/+3
|
* fix url_for with classesAaron Patterson2014-05-121-1/+1
|
* break each polymorphic type to it's own methodAaron Patterson2014-05-121-1/+5
|
* split nil / Hash cases in url_forAaron Patterson2014-04-301-4/+4
| | | | | | | this reduces the number of comparisons and method calls `url_for` requires. The nil case no longer calls `symbolize_keys`, we already know options is nil, so no more ||=, and since it is nil we already know that options[:host] will be nil too.
* Take Hash with options inside Array in #url_forAndrey Ognevsky2013-11-151-0/+2
|
* Move actionpack/lib/action_view* into actionview/libPiotr Sarnacki2013-06-201-0/+107