Adding routes via plugins


I’m attempting to add a route via a plugin. I attempted to add the
following to my init.rb:

myroute = ActionController::Routing::Routes.connect “boo2”,
:controller=>‘plugin’, :action=>‘index’
puts “path=#{myroute.path}”
myroute.options.keys.each do |k|
puts “#{k}=#{myroute.options[k]}”

The newly created route is coming back to me in my “myroute” varaible.
And I validate that the path and options are set. However the route
does not work.

Is there anything special I need to do to “activate” the route?

Thanks in advance. scott.

What’s an Intel chip doing in a Mac? A whole lor more that it’s ever
done in a PC.

My Digital Life -
Pro:Blog -
Snippets -

On Wednesday, June 21, 2006, at 2:37 PM, Scott W. wrote:


Rails mailing list
[email protected]

My understanding is that the routes get set up after the plugins get
loaded, so setting them in a plugin just gets over ridden by the

There may be a hack around this, but I think for the most part the best
solution is to add it manually ATM.


This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs