Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6108565
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T14:18:33+00:00 2026-05-23T14:18:33+00:00

How can I link up my routes so that the spec will pass? I

  • 0

How can I link up my routes so that the spec will pass? I have read here http://www.engineyard.com/blog/2010/the-lowdown-on-routes-in-rails-3/

The spec

require 'spec_helper'

    describe ConversationMembersController do
      describe "routing" do
        it "recognizes and generates #index" do
          { :get => "/conversations/123/members" }.should route_to(:controller => "conversation_members", :action => "index", :conversation_id=>"123")
        end
      end
    end

Failing spec

ConversationMembersController routing recognizes and generates #index
     Failure/Error: { :get => "/conversations/123/members" }.should route_to(:controller => "conversation_members", :action => "index", :conversation_id=>"123")
       The recognized options <{"action"=>"123", "id"=>"members", "controller"=>"conversations"}> did not match <{"conversation_id"=>"123",
        "action"=>"index",
        "controller"=>"conversation_members"}>, difference: <{"conversation_id"=>"123",
        "action"=>"index",
        "id"=>"members",
        "controller"=>"conversation_members"}>

The routes

resources :conversations, :except => [:edit] do
    resources :conversation_members, :as => "members", :except => [:show, :edit, :update, :destroy] do
      collection do
        delete :leave
      end
    end

The output of rake routes | grep conversation_members

52: leave_conversation_members DELETE /conversations/:conversation_id/conversation_members/leave(.:format)                                        {:action=>"leave", :controller=>"conversation_members"}
53: conversation_members GET    /conversations/:conversation_id/conversation_members(.:format)                                              {:action=>"index", :controller=>"conversation_members"}
54: POST   /conversations/:conversation_id/conversation_members(.:format)                                              {:action=>"create", :controller=>"conversation_members"}
55: new_conversation_member GET    /conversations/:conversation_id/conversation_members/new(.:format)                                          {:action=>"new", :controller=>"conversation_members"}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T14:18:34+00:00Added an answer on May 23, 2026 at 2:18 pm

    try this?

    resources :conversations, :except => [:edit] do
      resources :members, :controller => "conversation_members", :except => [:show, :edit, :update, :destroy] do
        collection do
          delete :leave
        end
      end
    end
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Can anyone link to or list out the object types that the iphone sdk
I can't link properly to glew. I have done: #define GLEW_STATIC #include glew/glew.h #pragma
How I can setup my rails app to respond to such urls: http://mydomain.com/white-halogene-lamp http://mydomain.com/children-lamps
I have a link marked :remote => true that makes a get request to
I have a non-resourceful route that uses a SHA token in the route. Here
I have a resource called patient_admissions that has all the RESTful routes. It is
I have a route that works (recognized, can follow it) in a Rails 3
with the following routes I try to achive the goal, that I can present
I have a flash media player (similar to lala.com) that needs to continue to
My MVC web application generates an activation link that can include any character (%,+,/,etc.).

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.