This project is archived and is in readonly mode.

#19 ✓resolved
Eugene Pimenov

Resource routes with :path_name and :member

Reported by Eugene Pimenov | April 18th, 2008 @ 07:33 PM

Commit 063c393bf0a2eb762770c97f925b7c2867361ad4 introduce bug with resource routes when member and path_names specified.

For example:

 map.routes :messages, :path_names => {:new => 'nuevo'}, :member => {:mark => :put}

and resources.rb lines 526-533

            action_options = action_options_for(action, resource, method)
            action_path = action
            if resource.options[:path_names]
              action_path = resource.options[:path_names][action]
              action_path ||= Base.resources_path_names[action]

            map.named_route("#{action}_#{resource.name_prefix}#{resource.singular}", "#{resource.member_path}#{resource.action_separator}#{action_path}", action_options)

Since :mark not in :path_names nor resources_path_names, it became nil,

and named_route tries to map /messages/:id to mark_messages_path.

Comments and changes to this ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href=""></a>

People watching this ticket