Forum: Ruby on Rails link/url helper with/for plugin routes

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
870b4945118795acabb0588675c89cf8?d=identicon&s=25 smacks (Guest)
on 2009-04-12 15:47
(Received via mailing list)
hi guys,

basically following the rails plugin guide, i set up a plugin with
routing, controllers, models, etc. now i'd also like to use the link/
url helper to do something like "link_to pluginName_path" or
"redirect_to pluginName_firstPluginController_path", but just can't
find out how.

my plugin routes are created from a yml config file which looks like:

defaults:
  base_route: :register
  process: [:profile, :confirm, :complete]

these routes are created by the plugin like:

module Register #:nodoc:
  module Routing #:nodoc:
    module MapperExtensions
      def register
        base_route = "/#{REGISTER_CONFIG['base_route']}"
        @set.add_route(base_route, {:controller => "#{REGISTER_CONFIG
['process'][0]}"})

        REGISTER_CONFIG['process'].each do |step|
          @set.add_route("#{base_route}/#{step}", {:controller =>
step.to_s})
        end
      end
    end
  end
end
ActionController::Routing::RouteSet::Mapper.send :include,
Order::Routing::MapperExtensions

and included in the app's routes.rb like:
map.register

this might not be the most beautiful code ever (improvements
appreciated), but it works for now and sets up the following routes
for i.e. an registration process:

/register
/register/profile
/register/confirm
/register/complete

now how can i set up and use link/url helper methods for links or
redirects to each of the steps in the registration process from views/
controllers of the app and from within the plugin?

hope anyone can help!
This topic is locked and can not be replied to.