https://www.redmine.org/https://www.redmine.org/favicon.ico?16793021292008-11-08T00:14:31ZRedmineRedmine - Feature #2142: Change the way plugin routes are integratedhttps://www.redmine.org/issues/2142?journal_id=54322008-11-08T00:14:31ZEric Davis
<ul><li><strong>Status</strong> changed from <i>New</i> to <i>Closed</i></li><li><strong>Target version</strong> set to <i>0.8</i></li><li><strong>% Done</strong> changed from <i>0</i> to <i>100</i></li><li><strong>Resolution</strong> set to <i>Fixed</i></li></ul><p>I really like your suggestion and changed the way plugin routing works in <a class="changeset" title="Removing the custom Redmine hook in routes in favor of Engine's hook. * Plugins' routes.rb are n..." href="https://www.redmine.org/projects/redmine/repository/svn/revisions/1991">r1991</a>. Plugins' <code>routes.rb</code> are now added automatically to Redmine's routing, including the ability to override Redmine's default routing.</p>
<p>Here's an example I put in a plugin to override the home page with the project list.</p>
<pre><code class="ruby syntaxhl"><span class="c1"># vendor/plugins/redmine_test_plugin/routes.rb</span>
<span class="n">map</span><span class="p">.</span><span class="nf">home</span> <span class="s1">''</span><span class="p">,</span> <span class="ss">:controller</span> <span class="o">=></span> <span class="s1">'projects'</span><span class="p">,</span> <span class="ss">:action</span> <span class="o">=></span> <span class="s1">'index'</span>
</code></pre> Redmine - Feature #2142: Change the way plugin routes are integratedhttps://www.redmine.org/issues/2142?journal_id=54332008-11-08T00:17:11ZEric Davis
<ul></ul><p>FYI: for documentation, the <code>map</code> object in my example isn't required, this will also work</p>
<pre><code># vendor/plugins/redmine_test_plugin/routes.rb
home '', :controller => 'projects', :action => 'index'
</code></pre> Redmine - Feature #2142: Change the way plugin routes are integratedhttps://www.redmine.org/issues/2142?journal_id=124922009-11-27T12:52:51ZJean-Baptiste Barth
<ul></ul><p>Just a quick note here since I may not be the only one to miss that : this way to configure routes in plugins has changed with <a class="changeset" title="Upgraded to Rails 2.3.4 (#3597) * Ran the Rails upgrade * Upgraded to Rails Engines 2.3.2 * Adde..." href="https://www.redmine.org/projects/redmine/repository/svn/revisions/2887">r2887</a>. You should have a look at <a href="http://www.redmine.org/boards/3/topics/8406" class="external">this thread</a> where Eric explains how to update your plugins.</p>