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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T23:23:41+00:00 2026-05-18T23:23:41+00:00

I created a routing test rails3 app with one model ‘User’: rails new routing_test_app

  • 0

I created a routing test rails3 app with one model ‘User’:

rails new routing_test_app
rails generate model User name:string
rails generate scaffold_controller admin/user
rake db:migrate

Added to routes.db:

namespace :admin do
  resources :users
end

rake routes

admin_users GET    /admin/users(.:format)          {:action=>"index", :controller=>"admin/users"}
admin_users POST   /admin/users(.:format)          {:action=>"create", :controller=>"admin/users"}
new_admin_user GET    /admin/users/new(.:format)      {:action=>"new", :controller=>"admin/users"}
edit_admin_user GET    /admin/users/:id/edit(.:format) {:action=>"edit", :controller=>"admin/users"}
admin_user GET    /admin/users/:id(.:format)      {:action=>"show", :controller=>"admin/users"}
admin_user PUT    /admin/users/:id(.:format)      {:action=>"update", :controller=>"admin/users"}
admin_user DELETE /admin/users/:id(.:format)      {:action=>"destroy", :controller=>"admin/users"}

views/admin/users/_form.html.erb

<%= form_for(@admin_user) do |f| %>
  <% if @admin_user.errors.any? %>
    <div id="error_explanation">
      <h2><%= pluralize(@admin_user.errors.count, "error") %> prohibited this admin_user from being saved:</h2>

      <ul>
      <% @admin_user.errors.full_messages.each do |msg| %>
        <li><%= msg %></li>
      <% end %>
      </ul>
    </div>
  <% end %>
    <%= f.text_field :name %>
  <div class="actions">
    <%= f.submit %>
  </div>
<% end %>

When I go to ‘http://localhost:3000/admin/users/new&#8217; rails throws an error:

undefined method `users_path' for #<#<Class:0x0000010116ca90>:0x000001011588d8>

Extracted source (around line #1):

1: <%= form_for(@admin_user) do |f| %>
2:   <% if @admin_user.errors.any? %>
3:     <div id="error_explanation">
4:       <h2><%= pluralize(@admin_user.errors.count, "error") %> prohibited this admin_user from being saved:</h2>
  • 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-18T23:23:42+00:00Added an answer on May 18, 2026 at 11:23 pm

    That’s because @admin_user is a User object, so Rails guesses the URL helper to be users_path. It’s a simple fix. Just replace @admin_user form_for param with [:admin, @admin_user]. You might also want to rename the instance variable @user for less repitition. Having to use the array is a drawback of using namespaces, so one should always take that into consideration.

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

Sidebar

Related Questions

I've created a very simple one-button MFC dialog app that attempts to utilize a
I just installed Rails, etc. on a Windows 7 machine. Created my first app,
I created a program using dev-cpp and wxwidgets which solves a puzzle. The user
I created an Interop user control in VS2005. When the user control is shown
I created a Rails application normally. Then created the scaffold for an event class.
I created a new SharePoint portal for testing purposes using a manually added HOSTS
While learning Rails I've created an application with a Domains controller nested below a
I am trying to test my routing configuration using the excellent MvcContrib.TestHelper and I've
I'm building a Rails 3 app and am trying to install acts_as_commentable Here's what
I created a few mediawiki custom tags, using the guide found here http://www.mediawiki.org/wiki/Manual:Tag_extensions 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.