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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T07:31:31+00:00 2026-05-29T07:31:31+00:00

I have a padrino project. I’ve created a sub app called users. I also

  • 0

I have a padrino project.

I’ve created a sub app called “users”.

I also have a model called user and a controller called users to handle the routing.

Users.controllers :users do

The issue with that is that the urls being produced and being responded to are

app.com/users/users/index
etc

unless I go to each action and map it

get :index, :map => '/' do

Is there a better way of doing this?

I don’t really want to put the actions in the app.rb for the app.. even though that works great. I like having the separation.

Is there anything like

Users.controllers :users do
    map '/'
end

Is there a naming convention that I can follow to create a default controller that would response to my apps root url?

I’d like to keep it in the users controller so that I can use the users_index etc

Gems included by the bundle:

activemodel (3.2.1)
activerecord (3.2.1)
activesupport (3.2.1)
arel (3.0.0)
bcrypt-ruby (3.0.1)
builder (3.0.0)
bundler (1.0.21)
haml (3.1.4)
http_router (0.10.2)
i18n (0.6.0)
mail (2.3.0)
mime-types (1.17.2)
multi_json (1.0.4)
padrino (0.10.6.c)
padrino-admin (0.10.6.c)
padrino-cache (0.10.6.c)
padrino-core (0.10.6.c)
padrino-gen (0.10.6.c)
padrino-helpers (0.10.6.c)
padrino-mailer (0.10.6.c)
polyglot (0.3.3)
rack (1.4.1)
rack-protection (1.2.0)
rack-test (0.6.1)
rake (0.9.2.2)
sass (3.1.13)
shoulda (2.11.3)
sinatra (1.3.2)
sinatra-flash (0.3.0)
sqlite3 (1.3.5)
thor (0.14.6)
tilt (1.3.3)
treetop (1.4.10)
tzinfo (0.3.31)
url_mount (0.2.1)

If I have to map the path for each action in the controller when my app name matches my controller name, that’s fine. I was just wondering if there was a way to set the base or root path for all my actions via the controller.

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-05-29T07:31:32+00:00Added an answer on May 29, 2026 at 7:31 am
    #padrino-core-0.10.6.c/lib/padrino-core/application/routing.rb
    
    #around line 655
    #method parse_route
    
    #right after unless controller.empty? i added the following which works in my case
    
       if controller.last.downcase == app_name.downcase and map.blank?
        controller = controller.slice(0, -2) unless controller.length == 1
        controller_path = controller.join("/")
        path.gsub!(%r{^\(/\)|/\?}, "")
        map = File.join(controller_path, path)
    end
    

    So now if I have an application called Users and a controller called Users to handle the routes, I can just say /users or /users/new etc instead of /users/users/new.

    Again, I’m very new to this, so I have no idea if this is the best way to handle this. I could have just set the map manually in each route, but that would be very annoying.

    I’m hoping that DAddYE can weight in on this and provide a better recommendation.

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

Sidebar

Related Questions

Have created a ATL COM project through which I am inserting Menu Items to
Have an app that can use tts to read text messages. It can also
I have been looking at Padrino for a project I am working on, and
I have a padrino install that is using datamapper and logging queries to a
In a Haml based Padrino solution I have an application.haml like this: !!! %html
I have an application that in uploading files to GridFS via MongoMapper/Joint in Padrino.
have been trying couple of hours now to make my iphone app universal. The
Have a website project in MVC3 C # where I retrieve information from the
Have started playing with Xcode 4.2, and created a single page application using storyboard
Have a rails app that is supposed to display a list of products/managers. After

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.