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.

router does not accept member for resource

#4624

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.

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

State: resolved
Milestone: none
Assigned to: Rizwan Reza Rizwan Reza
Importance: none

Activity

  1. gucki
    gucki
    • Tag set to member, resource, router

    May 17th, 2010 @ 08:14 AM

  2. gucki
    gucki
    • 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.

    May 17th, 2010 @ 08:21 AM

  3. Rizwan Reza
    Rizwan Reza
    • No changes were found…

    May 19th, 2010 @ 12:32 PM

  4. Damien MATHIEU
    Damien MATHIEU

    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

    May 19th, 2010 @ 01:23 PM

  5. Rohit Arondekar
    Rohit Arondekar
    • 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?

    May 23rd, 2010 @ 12:49 PM

  6. Rizwan Reza
  7. taohuaduoduo
    taohuaduoduo

    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.

    February 24th, 2011 @ 06:19 AM

  8. wendong
    wendong

    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.

    March 21st, 2011 @ 06:01 AM

  9. wendong
    wendong

    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.

    March 21st, 2011 @ 06:03 AM

  10. wendong
    wendong

    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

    March 21st, 2011 @ 06:06 AM

  11. wendong
    wendong

    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."

    March 21st, 2011 @ 06:06 AM

  12. brand shoes
    brand shoes

    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.”

    April 25th, 2011 @ 07:40 AM