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

The Archive Base Latest Questions

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

I have routes defined to some static pages and also to some controllers (users

  • 0

I have routes defined to some static pages and also to some controllers (users and usymptoms).
When I navigate to localhost:3000/users/1 or localhost:3000/users/1/usymptoms/new everything is fine. Once I finish filling in the form on symptoms/new, I have the usymptoms controller redirecting to @users. This works fine.

In the model file, the association is users has many usymptoms and usymptoms belongs to user.

However, now my static pages are not accessible. For example, when I navigate to /learn, I get the following error:

No route matches {:action=>”new”, :controller=>”usymptoms”, :user_id=>nil}

I am new to rails. Can you please help me figure out the error?

I have provided my routes file and the output from “rake routes” below.

My routes.rb file

root to: 'static_pages#home'
match '/about',   to: 'static_pages#about'
match '/contact', to: 'static_pages#contact'
match '/learn',   to: 'static_pages#learn'

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

resources :users do
  resources :usymptoms
end


resources :sessions, only: [:new, :create, :destroy]

======

Output from rake routes

              root        /                                            static_pages#home
             about        /about(.:format)                             static_pages#about
           contact        /contact(.:format)                           static_pages#contact
             learn        /learn(.:format)                             static_pages#learn
            signup        /signup(.:format)                            users#new
            signin        /signin(.:format)                            sessions#new
           signout DELETE /signout(.:format)                           sessions#destroy
    user_usymptoms GET    /users/:user_id/usymptoms(.:format)          usymptoms#index
                   POST   /users/:user_id/usymptoms(.:format)          usymptoms#create
 new_user_usymptom GET    /users/:user_id/usymptoms/new(.:format)      usymptoms#new
edit_user_usymptom GET    /users/:user_id/usymptoms/:id/edit(.:format) usymptoms#edit
     user_usymptom GET    /users/:user_id/usymptoms/:id(.:format)      usymptoms#show
                   PUT    /users/:user_id/usymptoms/:id(.:format)      usymptoms#update
                   DELETE /users/:user_id/usymptoms/:id(.:format)      usymptoms#destroy
             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
  • 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-17T08:41:12+00:00Added an answer on June 17, 2026 at 8:41 am

    You must have the following link somewhere: new_user_usymptom_path(@user), but @user is nil for some reason, hence the error.

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

Sidebar

Related Questions

I have the following routes defined: routes.MapRoute( Content Pages, {action}, new { controller =
In express, I have defined some routes app.post(/api/v1/client, Client.create); app.get(/api/v1/client, Client.get); ... I have
I have the following route's defined: public static void RegisterRoutes(RouteCollection routes) { routes.IgnoreRoute({resource}.axd/{*pathInfo}); routes.MapRoute(
I have my own routing rules in routes.php, defined for all the pages that
I have the following routes defined: public static void RegisterRoutes(RouteCollection routes) { routes.IgnoreRoute({resource}.axd/{*pathInfo}); routes.MapRoute(name:
Zend Project with multiple modules and every modules have its own routes.ini defined inside
In my MVC application I have a default route defined: routes.MapRoute( Default, // Route
I have a route defined like this: GET /question/:q_id controllers.Questions.viewQuestion(q_id: Long) Then in my
I have the following routes defined in my Global.asax: routes.MapRoute(name: Home, url: , defaults:
I have resources :campaigns defined in routes.rb. If I create a form_for @campaign in

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.