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 7645603
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T09:58:55+00:00 2026-05-31T09:58:55+00:00

I have a rails 3 nested resource defined as follows resources :candidates do collection

  • 0

I have a rails 3 nested resource defined as follows

resources :candidates do
  collection do
    get :bookmarked
  end
  resources :bookmarks, :only => [:create, :destroy]
end

The bookmarked action in the candidats collection will create a new bookmark for the candidate. This works fine as expected.

The problem arises when I try to delete a bookmark.

I have a link in my candidate show page as follows

<%= link_to "Remove bookmark", candidate_bookmarks_path(@candidate, @bookmark), :method => :delete %>

When I click on this link I get the following error

No route matches "/candidates/1/bookmarks.8"

I was expecting the url to be /candidates/1/bookmarks/8 not what is printed in the error. I was also expecting the request to be directed to the bookmarks controllers destroy method. But clearly that is not happening.

Can someone tell me what I am doing wrong. Any help appreciated.

  • 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-31T09:58:56+00:00Added an answer on May 31, 2026 at 9:58 am

    The path for destroy action should be candidate_bookmark_path(@candidate, @bookmark) instead of candidate_bookmarks_path(@candidate, @bookmark).

    Just remember, you are deleting a specific bookmark of a specific candidate, so the resources should be singular in your path, and you need to pass specific object for each resource.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following rails 3 nested resource: resources :books do resources :authors end
If I have a nested resource like so: resources :users resources :posts end and
I have a nested route in rails 3 mapped as resources :maps do resource
I have a nested resource, setup like this: resources :chickens do resources :eggs end
I have the following rails 3 nested models: resources :books do resources :authors end
In Rails 3 edge, I have set up two nested resources like this: config/routes.rb
So I have a Rails 3.1 app that contains nested resources: resources :projects do
I have a Rails application that has a Company resource with a nested resource
I'm using codebrew\backbone-rails in a nested model example (say I have a collection of
Let's say I have a nested resource like in the Rails guide example: http://guides.rubyonrails.org/routing.html#nested-resources

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.