# Link/url helper with/for plugin routes

**URL:** <https://www.ruby-forum.com/t/link-url-helper-with-for-plugin-routes/165334>\
**Category:** Rails\
**Created:** [April 12, 2009, 3:47pm UTC](https://www.ruby-forum.com/t/link-url-helper-with-for-plugin-routes/165334 "2009-04-12T15:47:40Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![smacks](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/b782af/32.png) [@smacks](https://www.ruby-forum.com/u/smacks)\
**Post date:** [April 12, 2009, 3:47pm UTC](https://www.ruby-forum.com/t/link-url-helper-with-for-plugin-routes/165334/1 "2009-04-12T15:47:40Z")

</div>

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!
