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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T15:00:08+00:00 2026-06-05T15:00:08+00:00

Here is the relevant line from my rake routes: client_note GET /clients/:client_id/notes/:id(.:format) notes#show When

  • 0

Here is the relevant line from my rake routes:

 client_note GET    /clients/:client_id/notes/:id(.:format)      notes#show

When I try passing in the objects like <%= client_note_path([client, @notes.first]) %>> I get:

No route matches {:action=>"show", :controller=>"notes", 
:client_id=>[#<Client id: 5, ... , #<Note id: 9, ...]}

Which made me think to try a client ID. So, I tried: <%= client_note_path([client.id, @notes.first]) %>

which gives me:

No route matches {:action=>"show", :controller=>"notes", :client_id=>[5, 
#<Note id: 9,content: "He just bought a brand new bobcat, be sure to charg...", 
client_id: 5, created_at: "2012-06-11 16:18:16", 
updated_at: "2012-06-11 16:18:16">]}

Which, made me want to try just passing in a client ID. <%= client_note_path(client.id) %>

No route matches {:action=>"show", :controller=>"notes", :client_id=>5}

Still not what I’m looking for. I want to be able to show an individual note which can normally be found at a url like looks like: http://localhost:3000/clients/2/notes/3/

What object(s) does it expect?

Complete Routes File and Rake Routes

           users GET    /users(.:format)                             users#index
                 POST   /users(.:format)                             users#create
        new_user GET    /users/new(.:format)                         users#new
       edit_user GET    /users/:id/edit(.:format)                    users#edit
            user GET    /users/:id(.:format)                         users#show
                 PUT    /users/:id(.:format)                         users#update
                 DELETE /users/:id(.:format)                         users#destroy
        sessions POST   /sessions(.:format)                          sessions#create
     new_session GET    /sessions/new(.:format)                      sessions#new
         session DELETE /sessions/:id(.:format)                      sessions#destroy
    client_notes GET    /clients/:client_id/notes(.:format)          notes#index
                 POST   /clients/:client_id/notes(.:format)          notes#create
 new_client_note GET    /clients/:client_id/notes/new(.:format)      notes#new
edit_client_note GET    /clients/:client_id/notes/:id/edit(.:format) notes#edit
     client_note GET    /clients/:client_id/notes/:id(.:format)      notes#show
                 PUT    /clients/:client_id/notes/:id(.:format)      notes#update
                 DELETE /clients/:client_id/notes/:id(.:format)      notes#destroy
         clients GET    /clients(.:format)                           clients#index
                 POST   /clients(.:format)                           clients#create
      new_client GET    /clients/new(.:format)                       clients#new
     edit_client GET    /clients/:id/edit(.:format)                  clients#edit
          client GET    /clients/:id(.:format)                       clients#show
                 PUT    /clients/:id(.:format)                       clients#update
                 DELETE /clients/:id(.:format)                       clients#destroy
            root        /                                            clients#index
          signup        /signup(.:format)                            users#new
          signin        /signin(.:format)                            sessions#new
         signout DELETE /signout(.:format)                           sessions#destroy

And:

resources :users 
resources :sessions, only: [:new, :create, :destroy]
resources :clients do
  resources :notes
end

root to: 'clients#index'

match '/signup',  to: 'users#new'
match '/signin',  to: 'sessions#new'
match '/signout', to: 'sessions#destroy', via: :delete

Additional Info:

Changing the line to <%= client_note_path(client, @notes.first) %> results in:

No route matches {:action=>"show", :controller=>"notes", :client_id=>#<Client id: 6, 
company_name: "John and Sons Roofing", contact_name: "John Wonder", phone_number: "1-    
555-283-9999", email_address: "bob@example.com", street_address: "13 Oak Street", city:
"Oakville", state: "Iowa", zip: "53457", image_location: "http://image-
location.com/image/john.jpg", created_at: "2012-06-11 16:18:16", updated_at: "2012-06-11    
16:18:16", url: "www.johnroofing.com">, :id=>nil}

Which gives me an id of nil. But, I have <%= @notes.first.blank? ? "No Notes" : @notes.first.content%> and that returns the notes content, so I don’t understand why it doesn’t work. Also, let’s try it with id, just for fun! <%= client_note_path(client.id, @notes.first.id) %>

And now we get: Called id for nil, which would mistakenly be 4 -- if you really wanted the id of nil, use object_id. Looking into the DB, the ID of the note is 9 and 5 for the client.

  • 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-06-05T15:00:13+00:00Added an answer on June 5, 2026 at 3:00 pm

    I believe your issue is that you are putting the objects into an array as a single parameter rather than just passing two parameters. The proper way is

    client_note_path(client, @notes.first)
    

    Note that you can pass in the object itself (as shown), or the id of the object for either or both.

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

Sidebar

Related Questions

Here is the relevant code from a Python script where a few commands are
I do not seem to understand how to catch constructor exception. Here is relevant
Here's the relevant code: <div data-bind=foreach: chats, visible: chats().length > 0> <input data-bind='value: $parent.newCommentText'
Here's the relevant code snippet. public static Territory[] assignTerri (Territory[] board, String[] colors) {
Here's the relevant code: public static void printBoarders (Territory x) { int t =
Here are the relevant models: User Product Order A User can sell or buy
Here's the relevant bit of the source code: class Dice { String name ;
Here's the relevant part of the Dice class: import java.util.*; class Dice { String
Superfish JS is here . Here's the relevant code: $.fn.extend({ hideSuperfishUl : function() {
I'm having some trouble with the jQuery hover method. Here's the relevant JavaScript code:

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.