Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

Resource routes with :path_name and :member

#19

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]
            end

            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.

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

State: resolved
Milestone: none
Assigned to: nobody
Importance: none

Activity

  1. Repository
    Repository
    • State changed from new to resolved

    (from [e6a3ce3392812f707b78d64ffb04ee52f4517d20]) Make sure member names aren't mistakenly set to nil when providing :path_names

    [#19 state:resolved]

    Signed-off-by: Michael Koziarski

    http://github.com/rails/rails/co...

    April 23rd, 2008 @ 09:23 AM