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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T22:37:00+00:00 2026-05-16T22:37:00+00:00

I have a Rails 3 engine gem that is for basic user authentication and

  • 0

I have a Rails 3 engine gem that is for basic user authentication and authorization. Within that Gem the config/routes.rb defines the following

resources :users
match '/:controller(/:action(/:id))'

When I do a rake routes from the application that requires this gem I get the following routes

rake routes|grep users
users GET   /users(.:format)               {:controller=>"users", :action=>"index"}
users POST  /users(.:format)               {:controller=>"users", :action=>"create"}
new_user GET  /users/new(.:format)         {:controller=>"users", :action=>"new"}
edit_user GET  /users/:id/edit(.:format)   {:controller=>"users", :action=>"edit"}
user GET   /users/:id(.:format)            {:controller=>"users", :action=>"show"}
user PUT   /users/:id(.:format)            {:controller=>"users", :action=>"update"}
user DELETE /users/:id(.:format)           {:controller=>"users", :action=>"destroy"}

This is what I expect.

However when I try to access the following routes via a browser

/users/137
/users/137/edit

I get the following error in the logs

AbstractController::ActionNotFound (The action '137' could not be found for UsersController):
  actionpack (3.0.0) lib/abstract_controller/base.rb:114:in `process'
  actionpack (3.0.0) lib/abstract_controller/rendering.rb:40:in `process'
  ...

What is interesting is that the following paths do work

/users/show/137
/users/edit/137

Also if I add the following to the routes.rb file in the application that is requiring the gem it all works as expected.

resources :users

Is there something I am missing or is this a bug?

Note that I am also doing the following when I start my application
on the command line when I start the rails I set the following env variable

RAILS_RELATIVE_URL_ROOT="/my_app"

and in config.ru

map '/my_app' do
  run MSEL::Application
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-05-16T22:37:01+00:00Added an answer on May 16, 2026 at 10:37 pm

    I experienced the same thing with a gem that I was creating. The engine routes are loaded after the application routes and I think this may be your problem. Take a look at rake routes without grepping for user. I suspect that you have a route in your application that takes precedence over the user routes. If you have match '/:controller(/:action(/:id))' in your application routes, then this will take precedence over the gem user route. Might explain why /users/show/137 works and not the RESTful routes. It may be possible to load your routes in the engine initializer to take precedence over the application routes. Post your full rake routes results and that may help us find a solution.

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

Sidebar

Related Questions

I have a Rails engine that defines a class method top(count) on a model
I have Rails application with mounted Engine. #{main_app}/config/routes.rb mount CommentIt::Engine => /talk, :as =>
I created a Rails 3 engine that is namespaced. Within my engine, I have
I have a Rails engine (someone else's gem) that I am trying to modify
The context : I have a rails engine (gem) that uses omniauth inside it
I have a engine style Rails plugin from which I can create a gem
I have managed to run a basic rails app1 on App Engine using: http://gist.github.com/268192
I have a rails engine code. But Rails::Engine don't have config.session_store variable. module Admin
Devise Authentication gem ( http://github.com/plataformatec/devise ) is a Rails tool to authenticate a user
I have a Rails 3 app that I am turning into a Rails engine

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.