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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T13:37:35+00:00 2026-06-13T13:37:35+00:00

I’m geting crazy with a namespace URL that leads to incorrect action ‘show’ instead

  • 0

I’m geting crazy with a namespace URL that leads to incorrect action ‘show’ instead of ‘new’.

When I’m using this URL : admin/admin_utilisateurs/new
I get this error :

Routing Error
No route matches {:action=>"show", :controller=>"admin/admin_utilisateurs"}
Try running rake routes for more information on available routes. 

This is the link_to I’m using in my index page :

link_to 'Nouveau', new_admin_admin_utilisateur_path, :class => 'btn-text btn-dimensions btn-encrusted metal'

These are my rake routes :

                                 root        /                                              welcome#index
                     pub_responsables GET    /catalogs/managers(.:format)                   pub_responsables#index
                                      POST   /catalogs/managers(.:format)                   pub_responsables#create
                  new_pub_responsable GET    /catalogs/managers/new(.:format)               pub_responsables#new
                 edit_pub_responsable GET    /catalogs/managers/:id/edit(.:format)          pub_responsables#edit
                      pub_responsable GET    /catalogs/managers/:id(.:format)               pub_responsables#show
                                      PUT    /catalogs/managers/:id(.:format)               pub_responsables#update
                                      DELETE /catalogs/managers/:id(.:format)               pub_responsables#destroy
        new_admin_utilisateur_session GET    /admin_utilisateurs/sign_in(.:format)          devise/sessions#new
            admin_utilisateur_session POST   /admin_utilisateurs/sign_in(.:format)          devise/sessions#create
    destroy_admin_utilisateur_session DELETE /admin_utilisateurs/sign_out(.:format)         devise/sessions#destroy
           admin_utilisateur_password POST   /admin_utilisateurs/password(.:format)         devise/passwords#create
       new_admin_utilisateur_password GET    /admin_utilisateurs/password/new(.:format)     devise/passwords#new
      edit_admin_utilisateur_password GET    /admin_utilisateurs/password/edit(.:format)    devise/passwords#edit
                                      PUT    /admin_utilisateurs/password(.:format)         devise/passwords#update
cancel_admin_utilisateur_registration GET    /admin_utilisateurs/cancel(.:format)           admin_utilisateurs/registrations#cancel
       admin_utilisateur_registration POST   /admin_utilisateurs(.:format)                  admin_utilisateurs/registrations#create
   new_admin_utilisateur_registration GET    /admin_utilisateurs/sign_up(.:format)          admin_utilisateurs/registrations#new
  edit_admin_utilisateur_registration GET    /admin_utilisateurs/edit(.:format)             admin_utilisateurs/registrations#edit
                                      PUT    /admin_utilisateurs(.:format)                  admin_utilisateurs/registrations#update
                                      DELETE /admin_utilisateurs(.:format)                  admin_utilisateurs/registrations#destroy
       admin_utilisateur_confirmation POST   /admin_utilisateurs/confirmation(.:format)     devise/confirmations#create
   new_admin_utilisateur_confirmation GET    /admin_utilisateurs/confirmation/new(.:format) devise/confirmations#new
                                      GET    /admin_utilisateurs/confirmation(.:format)     devise/confirmations#show
             admin_utilisateur_unlock POST   /admin_utilisateurs/unlock(.:format)           devise/unlocks#create
         new_admin_utilisateur_unlock GET    /admin_utilisateurs/unlock/new(.:format)       devise/unlocks#new
                                      GET    /admin_utilisateurs/unlock(.:format)           devise/unlocks#show
             admin_admin_utilisateurs GET    /admin/admin_utilisateurs(.:format)            admin/admin_utilisateurs#index
                                      POST   /admin/admin_utilisateurs(.:format)            admin/admin_utilisateurs#create
          new_admin_admin_utilisateur GET    /admin/admin_utilisateurs/new(.:format)        admin/admin_utilisateurs#new
         edit_admin_admin_utilisateur GET    /admin/admin_utilisateurs/:id/edit(.:format)   admin/admin_utilisateurs#edit
              admin_admin_utilisateur GET    /admin/admin_utilisateurs/:id(.:format)        admin/admin_utilisateurs#show
                                      PUT    /admin/admin_utilisateurs/:id(.:format)        admin/admin_utilisateurs#update
                                      DELETE /admin/admin_utilisateurs/:id(.:format)        admin/admin_utilisateurs#destroy

For info, I’m using Devise on a users table which I called “admin_utilisateurs”.
Devise is working great with options : :database_authenticatable, :confirmable, :recoverable, :registerable, :trackable, :timeoutable, :validatable, :lockable

The point is that I setup another controller for admin purpose on the admin_utilisateurs table.

So here it is my config/routes.rb

  root :to => 'welcome#index'

  resources :pub_responsables, :path =>'/catalogs/managers'

  devise_for :admin_utilisateurs, :controllers => {:registrations => 'admin_utilisateurs/registrations'}

  namespace :admin do
    resources :admin_utilisateurs
  end

So my admin controller is located in app/controllers/admin/admin_utilisateurs_controller.rb

Here is the action of my ‘new’ controller’s action :

class Admin::AdminUtilisateursController < ApplicationController

  before_filter :authenticate_admin_utilisateur!

  ...

  def new
    @admin_utilisateur = AdminUtilisateur.new
    respond_with(@admin_utilisateur)
  end

  ...
end

The view for that controller are located in app/view/admin/admin_utilisateurs/

But the issue is really connected to the route because the other path for ‘show’, ‘edit’ and ‘update’ are working properly.

And if I delete my controller app/controllers/admin/admin_utilisateurs_controller.rb, Rails is not complaining about missing controller, she’s still complaining about the “no route for show action”.

I’m really lost. Could anyone advise please ?
Thanks in advance

===== UPDATE 1 =====

Here it is the log related to my URL request :

Started GET "/admin/admin_utilisateurs/new" for 127.0.0.1 at 2012-10-25 12:55:05 +0200
Processing by Admin::AdminUtilisateursController#new as HTML
  Rendered shared/_main_title.html.haml (0.4ms)
  Rendered admin/admin_utilisateurs/_form.html.haml (17.2ms)
  Rendered admin/admin_utilisateurs/new.html.haml within layouts/application (31.7ms)
Completed 500 Internal Server Error in 45ms

ActionController::RoutingError (No route matches {:action=>"show", :controller=>"admin/admin_utilisateurs"}):
  app/views/admin/admin_utilisateurs/_form.html.haml:1:in `_app_views_admin_admin_utilisateurs__form_html_haml___780348754_85631840'
  app/views/admin/admin_utilisateurs/new.html.haml:9:in `_app_views_admin_admin_utilisateurs_new_html_haml__296364877_85537950'
  app/controllers/admin/admin_utilisateurs_controller.rb:51:in `new'

It seems that it is properly routed but then there is a problem in the view.

I retried to remove the controller file admin_utilisateurs_controller.rb but this time restart my web server (sudo service apache2 restart) and the error was different.
I got this time a “Routing error uninitialized constant Admin::AdminUtilisateursController”.

So this confrim there is an issue in my view…
digging deeper…

  • 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-13T13:37:36+00:00Added an answer on June 13, 2026 at 1:37 pm

    OK, I found the issue.
    The issue was coming from my partial form view which I use for my ‘edit’ action and for my ‘new’ action : /app/views/admin/admin_utilisateurs/_form.html.haml

    = form_for @admin_utilisateur, :url => admin_admin_utilisateur_path, :html => {:class => "formulaire-standard"} do |f|
    
      = render :partial => 'shared/error_message', :locals => { :element => @admin_utilisateur, :debut_erreur => 'Cet utilisateur ne peut être enregistré'}
    
      .groupe-champs
        .champ
          = f.label :nom
          = f.text_field :nom, :class => 'input-width-8-col', :required => 'required'
        .champ
          = f.label :prenom
          = f.text_field :prenom, :class => 'input-width-5-col', :required => 'required'
        .champ
          = f.label :telephone
          = f.telephone_field :telephone, :class => 'input-width-5-col', :required => 'required'
        .champ
          = f.label :mobile
          = f.telephone_field :mobile, :class => 'input-width-5-col'
        .champ
          = f.label :email
          = f.email_field :email, :class => 'input-width-8-col', :required => 'required'
    
      .groupe-champs
        = render :partial => 'shared/checkboxes_admin_utilisateur', :locals => { :resource => @admin_utilisateur }
    
    
      .groupe-champs
        .champ-1
          = f.check_box :approved
        .champ-5
          = f.label :approved
        .checkbox-explication
          = t('activerecord.attributes.admin_utilisateur.explanations.active')
    
      .separator
    
      .groupe-actions
        = f.submit 'Enregistrer', :class => 'btn-text btn-dimensions btn-encrusted metal'
        = link_to 'Annuler', admin_admin_utilisateur_path, :class => 'btn-text btn-dimensions btn-encrusted metal'
    

    I was using the form_for tag incorrectly. Because my form is used within a namespace, I must add the namespace into its arguments, and remove the :url option because otherwise this form will only work with the ‘edit’ action :

    = form_for [:admin, @admin_utilisateur], :html => {:class => "formulaire-standard"} do |f|
    

    This code lets Rails guess what path to use wether it’s for a new record or to edit an existing record. So I don’t need to specify the :url and the :method.

    The second mistake was (a classical one) the link_to at the bottom of the form.
    I forgot the ‘s’ at the end of the route helper (admin_admin_utilisateurSSSS_path):

    = link_to 'Annuler', admin_admin_utilisateurs_path, :class => 'btn-text btn-dimensions btn-encrusted metal'
    

    The moral of the story :

    ALLWAYS CHECK YOUR /log/development.log FILE ! 😉

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

Sidebar

Related Questions

I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I know there's a lot of other questions out there that deal with this
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a small JavaScript validation script that validates inputs based on Regex. I
For some reason, after submitting a string like this Jack’s Spindle from a text
this is what i have right now Drawing an RSS feed into the php,
I've got a string that has curly quotes in it. I'd like to replace

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.