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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T00:32:41+00:00 2026-06-12T00:32:41+00:00

Hi this is my first time using nested resources. I did rake routes and

  • 0

Hi this is my first time using nested resources. I did rake routes and found a path to new_user_album_path, but it doesn’t seem to work. Could the problem be because I did a double nest?

The problem is specifically when I click a link in my Users views file named show.html.erb . Trying to link to a “create an album” page but that’s when it shows me an error:

No route matches {:action=>"new", :controller=>"albums"}

Here are my files:

show.html.erb

<% provide(:title, "Welcome, #{@user.name}!") %>


<div>
    You currently have <%= pluralize(@user.albums.count, "album") %>
</div>

<div>
    <%= link_to "Create a new album!", new_user_album_path %>
</div>

<div>
<% if @user.albums.any? %>
hey
<% else %>
boo
<% end %>

</div>

<%= link_to "Back", users_path %>

Config/routes

Pholder::Application.routes.draw do
resources :users do
  resources :albums do
    resources :pictures
  end
end

Controller

class AlbumsController < ApplicationController
  def index
    @albums = Albums.all

    respond_to do |format|
      format.html
      format.json { render json: @albums }
    end
  end

  def new
    @user = User.find(params[:user_id])
  end
end
  • 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-12T00:32:43+00:00Added an answer on June 12, 2026 at 12:32 am

    You need to pass the user to the route method, like:

    new_user_album_path(@user)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is my first time using lightbox which uses jquery framework. But when I
The title seems confusing but this is my first time using ternary conditions. I've
This is my first time using XML documents. What I'm trying to do is
This is my first time using this site and I am quite new to
This is my first time using an external library, and I'm a bit nervous
This is my first time using jQuery and I am pleased to get my
This is my first time using Google Analytics Ecommerce Tracking to get data for
this is my first time using StAX for parsing XML documents (still in the
So this is my first time using cookies and i'm having some trouble setting
Sorry, this is my first time using this forum. Apparently people can edit my

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.