Shorthand for path method in resources
-
dan (at zeraweb)
- Milestone set to 0.8.0 - Frozen Donkey Wheel
- Assigned user changed from Matthew King to dan (at zeraweb)
- Tag set to mapping, resources
-
dan (at zeraweb)
Also, if redirect is given a symbol as an argument, I think it should automatically assume that it should call #path; and it should also have the two argument form, so that you can simply do:
redirect( :foo, :bar )
which is the same as
redirect( path( :foo, :bar ) )
which is the same as
redirect( path( FooApp::Resources::Bar.path( :foo ) ) )
-
dan (at zeraweb)
Which makes me wonder if there isn't some sort of pattern here ... esp. when you factor in multi-app scenarios:
:foo # => the foo mapping in current app and current resource
%w( bar foo ) # => foo in bar resource in current app
%w( foo_app bar foo ) # => fully qualified mapping reference
The only thing is that this is very confusing potentially:
%w( blog / entry / show )
could refer to the actual path spec:
[ :name ]
or something like that. That is, there are two paths: one logical and one that is the actual URL!
-
Matthew King
We don't have a path method defined in Mapping or Resources::Mixin right now. I'm assuming this refers to an instance method on a Resource that we need to define.
path(:foo) would be equivalent to SomeResource.new.paths.foo
??
-
dan (at zeraweb)
- State changed from new to resolved
This is implemented as a series of helpers in the response mixin that all follow the same pattern.
Example
# paths for the "local" app context paths( :entry ).show( name ) # paths for an arbitrary app paths( :blog, :entry ).show( name )
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.