#16 √ hold
Christoph Edthofer

map.from_plugin in a namespace?

Reported by Christoph Edthofer | June 3rd, 2008 @ 03:30 AM

I know this might be a stupid idea, but I want to use the routes from an engine in a namespace like:

namespace :admin do |admin|

admin.from_plugin :members_engine

end

I tried it, but it didn't work; I also changed the from_plugin method to something like this, so it doesn't throw an exception:

def from_plugin(name, *options)

map = self # to make 'map' available within the plugin route file

routes_path = Engines.plugins[name].routes_path

Engines.logger.debug "loading routes from #{routes_path}"

eval(IO.read(routes_path), binding, routes_path) if File.file?(routes_path)

end

However the path_prefix stuff gets ignored an I have no idea how to cram it in there. Also I have no idea how the namespacing would affect my engine's controllers, since they would have to be put into a module (like Admin::MembersController).

Comments and changes to this ticket

  • James Adam

    James Adam September 13th, 2008 @ 02:58 AM

    • → Tag cleared.
    • → State changed from “new” to “hold”

    This would be great to support, but it's not a top priority at the moment. Feel free to work up some tests and a patch though...

Please Login or create a free account to add a new comment.

You can update this ticket by sending an email to from your email client. (help)

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

The rails engines plugin itself

Shared Ticket Bins

People watching this ticket