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

  • Home
  • SEARCH
  • 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 6027957
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T04:40:05+00:00 2026-05-23T04:40:05+00:00

In my application I have users, and then each user has one mailbox where

  • 0

In my application I have users, and then each user has one mailbox where they’re delivered messages. My routes.rb looks something like:

  resources :users do
    resources :mailboxes 
  end

If I do a rake route, I see this route available to me:

user_mailbox GET    /users/:user_id/mailboxes/:id(.:format)                           {:action=>"show", :controller=>"mailboxes"}

I wanted to link to this path in my application layout, in a sort of toolbar the user finds at the top of the screen.

My view code is:

<%= link_to image_tag("mail_icon.png", :id => 'mail_notice'), user_mailbox_path(current_user)%>

The problem I’m having is that I get a routing error for this path if I’m nothing withing users/* – So anywhere else in my application besides the resource my mailbox is nested under. If I’m on, lets say my user’s index page, the path does work without issue.

No route matches {:action=>"show", :controller=>"mailboxes",

Is there something I could be missing with this route? Anything related to users works, it’s just the mailbox that I’m having issues with.

Thanks

  • 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-23T04:40:06+00:00Added an answer on May 23, 2026 at 4:40 am

    It sounds like mailbox should be a singleton resource.

    resources :users do
      resource :mailbox
    end
    

    Otherwise it would expect that a user has multiple mailboxes and you’d have to provide the mailbox_id to user_mailbox_path as well.

    user_mailbox_path(current_user, @mailbox)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In my web application we have many users.I want to set permission for each
I have an application in which users interact with each-other. I want to visualize
In my web application i have statistics which shown for each user separately ie.
My application has one table called 'events' and each event has approx 30 standard
Greetings, I have an application that allows users to import libraries (.NET DLLs) they've
The users of my web application may have more than one browser window open
The application I'm working on has an activity feed where each user can see
I'm working on a application where each user has to fill out an extensive
I'm working on an application where users have to make a call and type
I've got a rails application where users have to log in. Therefore in order

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.