I'm looking for a part-time remote job.

Hire me


I'm the author of:

Mastering Redmine is a comprehensive guide with tips, tricks and best practices, and an easy-to-learn structure.

Check the book's project or

Buy the book

Social pages of the book:

By buying this book you also donate to Redmine (see this page).


Follow me:

Bug #2104

Route error while rendering admin menu at version 1.4.4

Added by David Rahusen about 12 years ago. Updated over 11 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Target version:
Start date:
02 Oct 2012
Due date:
14 Jul 2013
% Done:

100%

Redmine version:
1.4.x
External issue:

Description

ActionView::TemplateError (No route matches {:controller⇒“project_aliases”, :action⇒“index”}) on line #3 of app/views/admin/_menu.html.erb:

project_alias_compat_1.4.5.patch View (1.37 KB) Spenser Gilliland, 11 Dec 2012 02:00

Associated revisions

Revision 15 (diff)
Added by Andriy Lesyuk over 11 years ago

Redmine 1.4.x support and Turkish translation (#2068 and #2104)

History

#1 Updated by David Rahusen about 12 years ago

Fixed!

Added file “routes.rb” into the config directory of the plugin. The file needs to have the following content:

ActionController::Routing::Routes.draw do |map|
  map.connect 'admin/plugins/project_alias/:action', :controller => 'project_aliases', :conditions => {:method => [:post, :get]}
end

Not yet fully tested, but I guess this plugin is now fully functional for redmine version 1.4.4.

#2 Updated by Thomas Jahns about 12 years ago

Even after adding the code listed in above update, I still get the following (with date/ip obfuscated):

Processing AdminController#index (for 377.456.189.1 at 2023-13-43 42:42:42) [GE
T]
  Parameters: {"action"=>"index", "controller"=>"admin"}
Rendering template within layouts/admin
Rendering admin/index

ActionView::TemplateError (No route matches {:action=>"index", :controller=>"pro
ject_aliases"}) on line #3 of app/views/admin/_menu.html.erb:
1: <div id="admin-menu">
2:   <ul>
3:     <%= render_menu :admin_menu %>
4:   </ul>
5: </div>

    lib/redmine/menu_manager.rb:150:in `render_single_menu_node'
    lib/redmine/menu_manager.rb:102:in `render_menu_node'
    lib/redmine/menu_manager.rb:91:in `render_menu'
    lib/redmine/menu_manager.rb:168:in `menu_items_for'
    lib/redmine/menu_manager.rb:165:in `each'
    lib/redmine/menu_manager.rb:165:in `menu_items_for'
    lib/redmine/menu_manager.rb:90:in `render_menu'
    app/views/admin/_menu.html.erb:3
    app/views/admin/index.html.erb:5
    /home/redmine/redmine/public/dispatch.fcgi:24

Rendering /home/redmine/redmine-1.4.4/public/500.html (500 Internal Server Error)

My redmine instance is installed in a sub-directory and this happens when trying to access the admin section. /home/redmine/redmine is a link to /home/redmine/redmine-1.4.4.

I’m very impressed the redmine makers introduced the route.rb change seemingly without any care whether the majority of plugins would be ready for the switch.

#3 Updated by Andriy Lesyuk about 12 years ago

  • Status changed from New to Open
  • Assignee set to Andriy Lesyuk
  • Target version set to 0.1.0

#4 Updated by Spenser Gilliland about 12 years ago

I’m running into a similar error although not exactly the same.

After installing the plugin. Access to <redmine_uri>/admin would fail with the same error as above.

After adding the routes.rb code above. Access to <redmine_uri>/admin works but creating a new alias causes the following error. Url is <redmine_uri>/admin/plugins/project_alias/new

Any suggestions for a fix?

Processing ProjectAliasesController#new (for 192.168.200.1 at 2012-12-10 19:21:23) [GET]
  Parameters: {"action"=>"new", "controller"=>"project_aliases"}
Rendering template within layouts/admin
Rendering project_aliases/new

ActionView::TemplateError (undefined method `errors' for :alias:Symbol) on line #3 of vendor/plugins/project_alias/app/views/project_aliases/new.rhtml:
1: <h2><%= link_to(l(:label_project_alias_plural), { :controller => 'project_aliases', :action => 'index' }) %> &#187; <%= l(:label_project_alias_new) %></h2
>
2: 
3: <%= error_messages_for :alias %>
4: 
5: <% form_for(@alias, :url => { :action => 'create' }, :builder => TabularFormBuilder) do |f| %>
6:   <div class="box tabular">

#5 Updated by Spenser Gilliland about 12 years ago

Worked on this a bit tonight. The following patch gets it to stop 500’ing.

This is all updates to the new.rhtml and adding routes.rb.

The first error which is mentioned above was fixed by adding routes.rb with the content specified.

The second error was that error_messages_for has been phased out and replaced with the following according to.
https://github.com/ivyl/redmine-gitolite/commit/af9fc062034cadc6d5e4a89e901c40df17bc06cd

Thirdly, the TabularFormBuilder has moved to Redmine::Views::LabelledFormBuilder according to.
http://www.redmine.org/boards/4/topics/32302

The diff is attached.

The following error is occurring and may or may not need to be fixed but as I have little rails experience I’m not really sure how to do that.

ActionController::RoutingError (No route matches "/plugin_assets/project_alias/stylesheets/admin.css" with {:method=>:get}):
  /usr/share/rubygems/gems/passenger-3.0.17/lib/phusion_passenger/rack/request_handler.rb:96:in `process_request'
  /usr/share/rubygems/gems/passenger-3.0.17/lib/phusion_passenger/abstract_request_handler.rb:517:in `accept_and_process_next_request'
  /usr/share/rubygems/gems/passenger-3.0.17/lib/phusion_passenger/abstract_request_handler.rb:274:in `main_loop'
  /usr/share/rubygems/gems/passenger-3.0.17/lib/phusion_passenger/classic_rails/application_spawner.rb:321:in `start_request_handler'
  /usr/share/rubygems/gems/passenger-3.0.17/lib/phusion_passenger/classic_rails/application_spawner.rb:275:in `send'
  /usr/share/rubygems/gems/passenger-3.0.17/lib/phusion_passenger/classic_rails/application_spawner.rb:275:in `handle_spawn_application'
  /usr/share/rubygems/gems/passenger-3.0.17/lib/phusion_passenger/utils.rb:470:in `safe_fork'
  /usr/share/rubygems/gems/passenger-3.0.17/lib/phusion_passenger/classic_rails/application_spawner.rb:270:in `handle_spawn_application'
  /usr/share/rubygems/gems/passenger-3.0.17/lib/phusion_passenger/abstract_server.rb:357:in `__send__'
  /usr/share/rubygems/gems/passenger-3.0.17/lib/phusion_passenger/abstract_server.rb:357:in `server_main_loop'
  /usr/share/rubygems/gems/passenger-3.0.17/lib/phusion_passenger/abstract_server.rb:206:in `start_synchronously'
  /usr/share/rubygems/gems/passenger-3.0.17/lib/phusion_passenger/abstract_server.rb:180:in `start'
  /usr/share/rubygems/gems/passenger-3.0.17/lib/phusion_passenger/classic_rails/application_spawner.rb:149:in `start'
  /usr/share/rubygems/gems/passenger-3.0.17/lib/phusion_passenger/spawn_manager.rb:219:in `spawn_rails_application'
  /usr/share/rubygems/gems/passenger-3.0.17/lib/phusion_passenger/abstract_server_collection.rb:132:in `lookup_or_add'
  /usr/share/rubygems/gems/passenger-3.0.17/lib/phusion_passenger/spawn_manager.rb:214:in `spawn_rails_application'
  /usr/share/rubygems/gems/passenger-3.0.17/lib/phusion_passenger/abstract_server_collection.rb:82:in `synchronize'
  /usr/share/rubygems/gems/passenger-3.0.17/lib/phusion_passenger/abstract_server_collection.rb:79:in `synchronize'
  /usr/share/rubygems/gems/passenger-3.0.17/lib/phusion_passenger/spawn_manager.rb:213:in `spawn_rails_application'
  /usr/share/rubygems/gems/passenger-3.0.17/lib/phusion_passenger/spawn_manager.rb:132:in `spawn_application'
  /usr/share/rubygems/gems/passenger-3.0.17/lib/phusion_passenger/spawn_manager.rb:275:in `handle_spawn_application'
  /usr/share/rubygems/gems/passenger-3.0.17/lib/phusion_passenger/abstract_server.rb:357:in `__send__'
  /usr/share/rubygems/gems/passenger-3.0.17/lib/phusion_passenger/abstract_server.rb:357:in `server_main_loop'
  /usr/share/rubygems/gems/passenger-3.0.17/lib/phusion_passenger/abstract_server.rb:206:in `start_synchronously'
  /usr/share/rubygems/gems/passenger-3.0.17/helper-scripts/passenger-spawn-server:102

#6 Updated by Spenser Gilliland about 12 years ago

The above error is a suburi problem /redmine should be prefixed to the location.

#7 Updated by Andriy Lesyuk over 11 years ago

  • Due date set to 14 Jul 2013
  • Status changed from Open to In Progress
  • % Done changed from 0 to 100

#8 Updated by Andriy Lesyuk over 11 years ago

  • Status changed from In Progress to Closed

Also available in: Atom PDF

Terms of use | Privacy policy