aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_dispatch/routing/polymorphic_routes.rb
Commit message (Collapse)AuthorAgeFilesLines
* drop allocations when handling model url generationAaron Patterson2015-02-281-1/+1
|
* Fix form_for to work with objects that implement to_modelTravis Grathwell2014-12-291-5/+6
| | | | | | | | | | | | | 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>
* Remove ActionController::ModelNamingclaudiob2014-12-251-4/+0
| | | | | | | | | | | | | | The methods in these modules are not used anywhere. They used to be invoked in polymorphic_routes.rb but their usage was removed in e821045. What is your opinion about removing these methods? They do belong to the public API, but in reality their code has already been duplicated to ActionView::ModelNaming, since they are used by methods like `dom_id` and `dom_class` to associated records with DOM elements (in ActionView). Please tell me if you think that removing this module is a good idea and, in that case, if the PR is okay as it is, or you'd rather start by showing a deprecation message, and remove the module in Rails 5.1.
* Keep the original implementation to not having to allocate new objectsRafael Mendonça França2014-09-251-2/+15
|
* Remove internal options from query string of pathsGert Goet2014-09-251-18/+3
| | | | Fixes #17057
* Allow polymorphic routes with nil when a route can still be drawnSammy Larbi2014-08-311-1/+2
| | | | | | | | | | | | | | | | Suppose you have two resources routed in the following manner: ```ruby resources :blogs do resources :posts end resources :posts ``` When using polymorphic resource routing like `url_for([@blog, @post])`, and `@blog` is `nil` Rails should still try to match the route to the top-level posts resource. Fixes #16754
* Merge pull request #15889 from carnesmedia/model-nameRafael Mendonça França2014-08-171-5/+5
|\ | | | | | | Use #model_name on instances instead of classes
| * Use #model_name on instances instead of classesAmiel Martin2014-06-241-5/+5
| | | | | | | | | | | | This allows rails code to be more confdent when asking for a model name, instead of having to ask for the class. Rails core discussion here: https://groups.google.com/forum/#!topic/rubyonrails-core/ThSaXw9y1F8
* | extract methods and metaprogram less.Aaron Patterson2014-08-141-11/+16
|/
* Simplify merge call on polymorphic helpersCarlos Antonio da Silva2014-05-131-2/+2
|
* use the helper method builder to construct helper methodsAaron Patterson2014-05-121-56/+107
|
* undo optimized calls until the builder object is finishedAaron Patterson2014-05-121-36/+19
|
* remove suffix from the handler methodsAaron Patterson2014-05-121-20/+19
|
* push list handling to the builder objectAaron Patterson2014-05-121-30/+30
|
* push string handling to the builder objectAaron Patterson2014-05-121-10/+8
|
* push model and class handling to a helper builder objectAaron Patterson2014-05-121-36/+48
|
* adding a method to handle strings using the same apiAaron Patterson2014-05-121-22/+32
|
* break each polymorphic type to it's own methodAaron Patterson2014-05-121-24/+81
|
* remove dead codeAaron Patterson2014-05-121-12/+0
|
* only test `persisted?` on the record onceAaron Patterson2014-05-121-3/+7
| | | | | also avoid the case of calling `persisted?` on something that doesn't respond to it
* only send options if there are any optionsAaron Patterson2014-05-121-5/+7
|
* remove should_pop variableAaron Patterson2014-05-121-4/+1
|
* only pop records when we get an arrayAaron Patterson2014-05-121-6/+7
|
* remove unnecessary array allocationsCoraline Ada Ehmke + Aaron Patterson2014-05-121-5/+1
|
* simplified route method name generationCoraline Ada Ehmke + Aaron Patterson2014-05-121-27/+17
|
* small refactoringCoraline Ada Ehmke + Aaron Patterson2014-05-121-6/+2
|
* pulling helpermethods up before refactoringCoraline Ada Ehmke + Aaron Patterson2014-05-121-20/+46
|
* push all is_a tests up, always pass options to the named routeAaron Patterson2014-05-121-28/+27
|
* pull nil checks upAaron Patterson2014-05-121-3/+5
|
* skip another Array is_a checkAaron Patterson2014-05-121-4/+6
|
* only do the Array is_a check onceAaron Patterson2014-05-121-4/+3
|
* we always convert this variable to a list, so we can remove the unconversionAaron Patterson2014-05-121-1/+0
|
* record as a hash is not possible, so rm branchAaron Patterson2014-05-121-2/+0
|
* stop popping in build_named_route_callAaron Patterson2014-05-121-4/+3
|
* remove extract_record since we have extracted the listAaron Patterson2014-05-121-12/+1
|
* always pass a list to build_named_route_callAaron Patterson2014-05-121-10/+19
|
* add a test for passing two models to the polymorphic_url methodAaron Patterson2014-05-121-1/+1
|
* extract route key translation to a method and reuse itAaron Patterson2014-05-121-17/+14
|
* Use #include? instead of #any?, make it simplerAkshay Vishnoi2014-05-031-1/+1
|
* passing a nil in the polymorphic array is not supported. remove nils before ↵Aaron Patterson2014-05-021-0/+4
| | | | you call the method
* passing a nil should always raise an ArgumentErrorAaron Patterson2014-05-021-1/+0
|
* only add the optiosn if they are not emptyAaron Patterson2014-05-011-1/+3
| | | | | | I think this is wrong, but it gets the build passing for now. We should always add options, but we need to make more guarantees about how the underlying url helper is called
* always pass options to the _url methodAaron Patterson2014-05-011-3/+1
|
* never merge url options in to the first data hashAaron Patterson2014-05-011-1/+1
| | | | | if you want options, don't mix them with the first hash, just pass them all in with the second hash
* avoid calling extract_record multiple timesAaron Patterson2014-04-301-3/+2
|
* eliminate conditional when sending the named route methodAaron Patterson2014-04-301-2/+4
|
* Adding documentation to +polymorphic_url+wangjohn2013-06-131-0/+13
| | | | | | | concerning the options that it inherits from +url_for+. The way that +polymorhpic_url+ is built allows it to have options like +:anchor+, +:script_name+, etc. but this is currently not documented.
* Cleans and removes useless 'Examples' tag [ci skip]Alvaro Pereyra2012-12-011-2/+0
|
* 1.9 hash syntax changes to docsAvnerCohen2012-10-311-3/+3
|
* Revert "polymorphic_url with an array generates a query string"Andrew White2012-08-041-4/+1
| | | | | Passing options as the last value in an array doesn't work with form_for. This reverts commit 61c8a4d926343903593a27080216af7e4ed81268.