aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_dispatch/routing/url_for.rb
Commit message (Collapse)AuthorAgeFilesLines
* Privatize unneededly protected methods in Action PackAkira Matsuda2016-12-241-2/+4
|
* normalizes indentation and whitespace across the projectXavier Noria2016-08-061-12/+12
|
* Add more info to insecure URL generation errorDerek Prior2016-04-261-1/+1
| | | | | | | | I always appreciate having a bit more information as to why something is now an error. We can use this error to tell people why what they were previously doing is insecure and give them hints on how to fix it. Signed-off-by: Kasper Timm Hansen <kaspth@gmail.com>
* Use a URL instead of an URL everywhereAbhishek Jain2016-02-151-1/+1
|
* Prevent ActionController::Parameters from being passed to url_for directlyJean Boussier2015-12-151-1/+4
|
* [ci skip] Change 'an URL' to 'a URL' as URL doesn't have a vowel soundtanmay30112015-10-061-1/+1
|
* `url_for` does not modify polymorphic optionsBernerd Schaefer2015-09-041-1/+2
| | | | | | | | | | | | | | | | | 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/+4
| | | | | | | | 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.
* [ci skip] Improve the url_for documentationRoque Pinel2015-07-011-3/+19
| | | | | | | | | Clarify the `url_for` usage in mailers. Re-add the documentation about `url_for` and Route's path parameters, first introduced by 5c4f1859970d06228a0b67cad6d4486c1526ef2a. This was reported on #15097 and until it is decided to deprecate it or not, I believe the documentation should exist.
* move _generate_paths_by_default to where it is usedAaron Patterson2015-03-011-6/+0
| | | | | _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-0/+6
|
* remove some cachingAaron Patterson2014-07-281-2/+1
| | | | | this caching doesn't increase performance, but does increase complexity. remove it for now and find better ways to speed up this code.
* pass the route name to define_url_helperAaron Patterson2014-07-171-1/+3
| | | | | this allows us to avoid 2 hash allocations per named helper definition, also we can avoid a `merge` and `delete`.
* use the helper method builder to construct helper methodsAaron Patterson2014-05-121-1/+5
|
* undo optimized calls until the builder object is finishedAaron Patterson2014-05-121-1/+1
|
* Take Hash with options inside Array in #url_forAndrey Ognevsky2013-11-151-0/+2
|
* Fix link_to return valueEarl J St Sauver2013-09-221-1/+1
| | | | | | The documentation is showing the link_to method as just returning the contents of the url_for method. It should be returning an "<a>" tag with the correct href set.
* Add script_name option description and example for #url_for optionsIvan Vanyak2012-12-171-0/+5
|
* 1.9 hash syntax changes to docsAvnerCohen2012-10-311-15/+15
|
* removed : warning: `*' interpreted as argument prefixArun Agrawal2012-08-281-1/+1
|
* Don't require action_dispatch in ActionView::UrlHelpersPiotr Sarnacki2012-08-281-0/+2
| | | | | | | | | | ActionDispatch::Routing::UrlFor was always required in UrlHelpers. This was changed by splitting previous implementation of UrlHelper into 2 modules: ActionView::Helpers::UrlHelper and ActionView::Routing::UrlHelper. The former one keeps only basic implementation of url_for. The latter adds features that allow to use routes and is only required when url_helpers or mounted_helpers are required.
* fix typo in documentationAnatoly Makarevich2012-07-261-1/+1
|
* Removing ==Examples and last blank lines of docs from actionpackFrancesco Rodriguez2012-05-151-2/+0
|
* Corrected the name of the module that should be included to get the url helpers.Anuj Dutta2012-05-031-1/+1
|
* Revert "Merge pull request #5750 from ahoward/master"Santiago Pastorino2012-04-081-10/+1
| | | | | | | This reverts commit 174cf8b22064c3999dfa685014d5b31ac993bb54, reversing changes made to 7ecd6a731bd60665bc6de94095137f0b2c4ada2a. The reverted commit improved the performance in the wrong place, now we have added this 6ddbd1844a6fd6aca2992f5f75c9f605cf89808f improvement.
* Make url_for work when option is nil and default_url_options hasRafael Mendonça França2012-04-051-1/+1
| | | | stringified keys
* url_for: avoid a nil check. unroll a loop. handle most common case 1st.ara.t.howard2012-04-051-18/+13
|
* carefully and quickly merge url_for optionsara.t.howard2012-04-041-1/+17
|
* Optimize url helpers.Sergey Nartimov + José Valim2012-03-021-2/+5
|
* Optimize path helpers.José Valim2012-03-021-0/+5
|
* Clean up routes inclusion and add some comments for the next soul that ↵José Valim2012-01-031-11/+12
| | | | decides to adventure on this code.
* just add the writer rather than adding both and removing oneAaron Patterson2011-12-291-2/+1
|
* Move symbolize keys to the inner options as we can assume url_options will ↵José Valim2011-12-081-1/+1
| | | | be properly symbolized.
* what's -> that'sUģis Ozols2011-11-251-1/+1
|
* Remove unnecessary comment.Uģis Ozols2011-11-251-1/+1
|
* :subdomain can now be specified with a value of false in url_for, allowing ↵Kamil Sobieraj2011-10-041-2/+3
| | | | for subdomain(s) removal from the host during link generation. Closes #2025
* doc fixesVijay Dev2011-08-281-4/+8
|
* We actually don't need a reverse_merge! here. dup removed was giving error ↵Arun Agrawal2011-08-121-1/+1
| | | | with nil class.
* when calling url_for with a hash, additional (likely unwanted) values (such ↵Andrew Kaspick2011-08-111-1/+1
| | | | as :host) would be returned in the hash... calling #dup on the hash prevents this
* Remove extra white spaces on ActionPack docs.Sebastian Martinez2011-05-231-1/+1
|
* Follow code conventions on docsSebastian Martinez2011-05-101-4/+4
|
* copy-edits RDoc of 2fe43b6Xavier Noria2010-11-231-2/+3
|
* :subdomain, :domain and :tld_length options can now be used in url_for, ↵Josh Kalderimis2010-11-231-0/+6
| | | | | | allowing for easy manipulation of the host during link generation. Signed-off-by: José Valim <jose.valim@gmail.com>
* Avoid (@_var ||= nil) pattern by using initialize methods and ensuring ↵José Valim2010-09-291-1/+5
| | | | everyone calls super as expected.
* Remove more warnings on variables.Emilio Tagua2010-09-281-0/+1
|
* Define @_routes inside method, makes more sense and will be initialized when ↵Emilio Tagua2010-09-271-1/+0
| | | | | | called anywhere. Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
* Initialize @_routes if it doesn't exists.Emilio Tagua2010-09-271-0/+1
|
* Refactor RoutesProxy to avoid using _with_routes in helpersPiotr Sarnacki2010-09-031-0/+4
|
* Add mounted_helpers to routesPiotr Sarnacki2010-09-031-21/+7
| | | | | | | | | | | | | | | | mounted_helpers are a bit similar to url_helpers. They're automatically included in controllers for Rails.application and each of mounted Engines. Mounted helper allows to call url_for and named helpers for given application. Given Blog::Engine mounted as blog_engine, there are 2 helpers defined: app and blog_engine. You can call routes for app and engine using those helpers: app.root_url app.url_for(:controller => "foo") blog_engine.posts_path blog_engine.url_for(@post)
* Routes refactoring:Piotr Sarnacki2010-09-031-6/+4
| | | | | | | * added more tests for prefix generation * fixed bug with generating host for both prefix and url * refactored url_for method * organized tests for prefix generation