Adding routes via plugins

Hi,

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]}”
end

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 - http://scottwalter.com/blog
Pro:Blog - http://scottwalter.com/problog
Snippets - http://snippets.scottwalter.com

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

end

Rails mailing list
[email protected]
http://lists.rubyonrails.org/mailman/listinfo/rails

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
defaults.

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

_Kevin