Open bragi opened 14 years ago
I think it is a good idea to do the ticket http://github.com/bragi/representations/issues#issue/33 before starting work on this one.
taken.
Simple implementation:
Add method that builds path for representation (it should behave a bit like url_for()). This method takes provided namespace into consideration. Each AR representation stores namespace (remember: namespaces can be nested!) When you call .namespace() it returns clone of representation but with new namespace added to the chain. This means when you call path creating method on this representation it will take all namespaces into account.
.namespace and .current_namespace (namespace builder) methods created. They work in views as desired. Some tests to be done.
Add
namespace
method that allows to 'move' representation to another namespace.Usage is:
Alternatively:
This will create a form that submits to /administration/profiles instead of /profiles.
It should be possible to create namespaced representations for both nested and top level namespaces.