This project is archived and is in readonly mode.

#4624 ✓resolved
gucki

router does not accept member for resource

Reported by gucki | May 17th, 2010 @ 08:13 AM

A definition like

resource :search do
  member do
    post :order
  end
end

results in
ArgumentError: can't use member outside resources scope

Member does only seem to work for resourceS, as Collection does. But Member should also be available resource.

Comments and changes to this ticket

  • gucki

    gucki May 17th, 2010 @ 08:14 AM

    • Tag set to member, resource, router
  • gucki

    gucki May 17th, 2010 @ 08:21 AM

    • Tag changed from member, resource, router to fix, member, resource, router

    Here's a fix which just seems to work fine :)

    Replace

          unless @scope[:scope_level] == :resources
            raise ArgumentError, "can't use member outside resources scope"
          end
    

    with

          unless [:resource, :resources].include?(@scope[:scope_level])
            raise ArgumentError, "can't use member outside resource(s) scope"
          end
    

    in action_dispatch/routing/mapper.rb at like 624.

  • Rizwan Reza

    Rizwan Reza May 19th, 2010 @ 12:32 PM

    • no changes were found...
  • Damien MATHIEU

    Damien MATHIEU May 19th, 2010 @ 01:23 PM

    gucki: would it be possible to create a valid patch and attach it here please ?
    You can see a guide explaining how to do it here : https://rails.lighthouseapp.com/projects/8994/sending-patches

  • Rohit Arondekar

    Rohit Arondekar May 23rd, 2010 @ 12:49 PM

    • Assigned user set to “Rizwan Reza”

    I tried making a patch, but when trying to add a test I struggled with the path. So I made a patch for the code change, created a edge rails app and added the route:


    resource :search do

    member do
      post :order
    end
    

    end

    And did rake routes to get a strange entry:

    order_search_search POST /search/:id/order(.:format) {:action=>"order", :controller=>"searches"}

    Basically I don't think you can just bypass that check without fixing something deeper inside. Thoughts?

  • Rizwan Reza

    Rizwan Reza June 7th, 2010 @ 02:32 AM

    • State changed from “new” to “resolved”
  • taohuaduoduo

    taohuaduoduo February 24th, 2011 @ 06:19 AM

    Know your shape. When you want to buy Formelle Cocktailkleider, you’ll want to find one which is best for your figure because there are so many wedding dresses for sale. An A-line shape is flattering to most Perlen Cocktailkleid, as it can skim over hips. A v-neckline on a full figured woman can also add an attractive contrasting line. Avoid full ball gown skirts as they can increase an overall Perfekte Cocktailkleider. It is recommended to also avoid tea-length gowns, as they tend to make women look Zierliche Cocktailkleider and ankle-heavy.

  • wendong

    wendong March 21st, 2011 @ 06:01 AM

    Know your shape. When you want to buy , you’ll want to find one which is best for your figure because there are so many wedding dresses for sale. An A-line shape is flattering to most Perlen Cocktailkleid, as it can skim over hips. A v-neckline on a full figured wom
    nba jerseys an can also add an attractive contrasting line. Avoid full ball gown skirts as they can increase an overall Perfekte Cocktailkleider. It is recommended to also avoid tea-length gowns, as they tend to make women look Zierliche Cocktailkleider and ankle-heavy.

  • wendong

    wendong March 21st, 2011 @ 06:03 AM

    T-Mobile's 33 million subscribers will give AT&T the dominant position in the mobile market and leaveVibram five fingers the U.S. with only one GSM carrier.

  • wendong

    wendong March 21st, 2011 @ 06:06 AM

    Earlier, he said he had not seen any evidence of civilian casualties, despite government claims that planes had bombed civilian targets in Tripoli, causing casualties.

    A Libyan official ha d told AFP at least 48 people had died and 150 were hurt - mainly women and children - in the coalition assaults, dubbed Operation Odyssey Dawn by the US, and Opera

  • wendong

    wendong March 21st, 2011 @ 06:06 AM

    In a key note of dissent, the international strikes were condemned by the Arab League, just a week after it urged the United Nations to impose a no-fly zone over Libya.

    Arab League Secretamoncler jacketsry-General Amr Mussa said: "What has happened in Libya differs from the goal of imposing a no-fly zone and what we want is the protection of civilians and not bombing other civilians."

  • brand shoes

    brand shoes April 25th, 2011 @ 07:40 AM

    It emanated from Carter. A high school dropout who lived with a mother on drugs, and who at one point saw all seven of his uncles in prison, at 35 Carter is the oldest player on the Knicks. He didn’t single-handedly keep Boston from scoring a basket during that stretch, but he twice poked the ball away from the Celtics and grabbed rebounds and kicked the ball ahead to a streaking Melo and took a moment to point at Spike’s Easter hat (seriously) http://www.brandshoes2u.com/ and pretty much had the sort of game the Garden expected when the playoffs returned to NYC.

    “We couldn’t go out with no blowout,” said Carter, who scored 11 points on 5-of-7 shooting in that quick burst. “Guys did a great job of coming in and making sure that we didn’t go out like that.”

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="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

Attachments

Referenced by

Pages