Project

General

Profile

Nicer plugin URL

Added by Nick Bolton almost 14 years ago

I've created a plugin with a project module. However, I note that I need to pass the project name in the url as part of a query string, e.g.:

/myplugin?project_id=plugintest

... instead of part of in the path, e.g.:

/plugintest/myplugin

Is there a way to get my URL to look like the later?


Replies (2)

RE: Nicer plugin URL - Added by Felix Schäfer almost 14 years ago

Create appropriate routes in your plugin's routes.rb file, have a look at the tutorial, existing plugins or even redmine core for examples, or read up the rails guides.

RE: Nicer plugin URL - Added by Nick Bolton almost 14 years ago

Thanks, that worked perfectly.

I added the following to my config/routes.rb file (in my plugin).

ActionController::Routing::Routes.draw do |map|
  map.connect '/projects/:id/hello_world/:action', :controller => 'foobar'
end
    (1-2/2)