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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T06:38:56+00:00 2026-06-16T06:38:56+00:00

I have two resources – users and lists, which I want to nest. Everything

  • 0

I have two resources – users and lists, which I want to nest. Everything worked fine, but as soon as i nest lists in users, it throws en error. It works fine on localhost – its just the tests that fails.

This is one of the errors:

  1) Authentication signin with valid information 
     Failure/Error: before { sign_in user }
     ActionView::Template::Error:
       undefined method `lists_path' for #<#<Class:0x007fecbd7812f0>:0x007fecbad265a0>
     # ./app/views/shared/_create_list.html.erb:2:in `_app_views_shared__create_list_html_erb___4033534818329635871_70327383327980'
     # ./app/views/users/show.html.erb:17:in `_app_views_users_show_html_erb___4510442023060893439_70327361676640'
     # (eval):2:in `click_button'
     # ./spec/support/utilities.rb:7:in `sign_in'
     # ./spec/requests/authentication_pages_spec.rb:32:in `block (4 levels) in <top (required)>'

routs.rb

MyApp::Application.routes.draw do
  resources :users do
    resources :lists, only: [:show, :create, :destroy]
  end
  resources :items, only: [:show, :create, :destroy]
  resources :sessions, only: [:new, :create, :destroy]

list.rb

class List < ActiveRecord::Base
  attr_accessible :name
  belongs_to :user
  has_many :items, dependent: :destroy

  validates :name, presence: true, length: { maximum: 60 }
  validates :user_id, presence: true
end

user.rb

class User < ActiveRecord::Base
  attr_accessible :name, :email, :password, :password_confirmation
  has_secure_password
  has_many :lists, dependent: :destroy
  has_many :items, through: :lists

Any suggestions are much appreciated! 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-06-16T06:38:57+00:00Added an answer on June 16, 2026 at 6:38 am

    I had to update my paths in my app. Instead of list_path(list), it has to be user_list_path(user, list)

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

Sidebar

Related Questions

I have two resources: resources :users do resources :cars end The association is: A
I have two resources Dock and Undock in my View which is a UserControl(Dock.xaml),
So In my rails app I have two resources (rentals, and reservations) which belong
I have two resources in my XAML which represent a Star and a Half
I have two files in my src/main/resources and I want one file's body to
I want to translate property. I have two resources files: DataResource.resx and DataResource.en.resx .
I have these two resources: App.Users = DS.Model.extend({ first_name: DS.attr('string'), last_name: DS.attr('string'), email: DS.attr('string'),
I have two classes (MVC view model) which inherits from one abstract base class.
I have two update panels on a page. And I want to update both
I have two resources file in res/values directory: string.xml and names.xml how can I

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.