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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T21:16:03+00:00 2026-06-03T21:16:03+00:00

rake routes is very slow (30s in my computer) but I need it for

  • 0

rake routes is very slow (30s in my computer) but I need it for routing spec.

So, is there a way to get all routes like rake routes? (or how rake routes works?)

I use Rails 3 and all I have seen is for Rails 3, and I found nothing I can use in the rails doc.

  • 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-03T21:16:05+00:00Added an answer on June 3, 2026 at 9:16 pm

    Rails.application.routes.routes.to_a

    .to_a is optional, it just converts it to an array.

    (I found this line in railties/lib/rails/tasks/routes.rake)

    I use it like :
    routes[10].defaults => {:action=>"edit", :controller=>"polls"}

    Edit : You can find the (quite hacky) way I do my routing specs here : https://gist.github.com/52ac6d848ce0d9fd52ac

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

Sidebar

Related Questions

can I get all routes in my rails application? I need an output like
I have following from rake routes: user GET /users/:id(.:format) {:action=>show, :controller=>users} But when I
my routes should look like this: >rake routes GET /categories/:category_id/articles(.:format) {:controller=>articles, :action=>index} category_articles POST
According to rake routes, there's the same path for getting an index of objects
rails 3.1 rake routes for admin/sections_contoller trigger_admin_section GET /admin/sections/:id/trigger(.:format) {:action=>trigger, :controller=>admin/sections} admin_sections GET /admin/sections(.:format)
In rails, on can show the active routes with rake ( http://guides.rubyonrails.org/routing.html ): $
I used rake routes to print out all of the routes in my application.
Whenever I run a rake command (i.e. rake routes ) I get this error:
In my rake routes I get: project_todos GET /project_todos(.:format) project_todos#index POST /project_todos(.:format) project_todos#create new_project_todo
Rake Routes lists: program_reports GET /programs/:program_id/reports(.:format) reports#index Yet putting this in a layout file

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.