Displaying 4 results from an estimated 4 matches for "polymorphicroutes".
Did you mean:
polymorphic_routes
2012 Sep 03
0
undefined method `singular_route_key' for "User":ActiveModel::Name
In ActionDispatch::PolymorphicRoutes, there is a call to
build_named_route_call an on line 172 (of latest rails code from
github), there is a call to singular_route_key:
model_name_from_record_or_class(parent).singular_route_key
Now model_name_from_record_or_class returns an ActiveModel::Name
object, which is a wrapper to the strin...
2012 Sep 04
0
dynamic route generation
In polymorphic_routes.rb, line 131, a name route that has been built
(e.g. post_users_path) gets invoked on self (assuming there was not
RoutesProxy instance appended as the first element of the array passed
as the first argument to form_for, then send() would be invoked on
self, which is PolymorphicRoutes module, which belongs to
ActionDispatch::Routing):
(proxy || self).send(named_route, *args)
so where exactly is post_users_path, for example, defined (and its
obvious that it must being defined dynamically using instance_eval or
class_eval based on the resource generation of routes).
but I would...
2010 Nov 01
2
Creating RESTful helpers on the fly
If I have a resource called ''assets'' then I get for free a bunch of
helpers, like
assets_path
new_asset_path
and so forth, right?
I would like to be able to create a call to one of these on the fly when
I only find out the name of the resource at run time. For example I
would like to do this:
resource_name = "assets"
resource_path(resource_name, method => :new)
2008 Jan 21
8
Polymorphic URL helpers documentation and fixes
...the code slightly
(nothing major, though). The patch also includes two fixes by Geoff Buesing,
who has done awesome work in this area in the past.
http://dev.rubyonrails.org/ticket/10883
Check the documentation, please yell if anything is wrong:
http://dev.rubyonrails.org/attachment/ticket/10883/PolymorphicRoutes.html?format=raw
What''s still broken? (I decided not to fix everything in one go.)
1. Hash argument: polymorphic_url(:id => @article). Test is commented
out (like before).
2. Should this work: polymorphic_url(@article, :format => :pdf) ?
Currently it doesn''t. I&...