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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T13:45:50+00:00 2026-05-23T13:45:50+00:00

I already have this in my routes file: namespace :api do root :to =>

  • 0

I already have this in my routes file:

namespace :api do
    root :to => 'graphs#index' #default page when accessing /admin
    resources :graphs, :defaults => { :format => 'json' }

    match ':graphs/:id(/:method)'
  end

But when I try to open:

mydomain.com/api 

or

mydomain.com/api/graphs/

I got the following error:

2011-07-06T23:12:06+00:00 app[web.1]: /app/.bundle/gems/ruby/1.9.1/gems/actionpack-3.0.9/lib/action_dispatch/routing/mapper.rb:171:in `default_controller_and_action': missing :action (ArgumentError)
2011-07-06T23:12:06+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.9.1/gems/actionpack-3.0.9/lib/action_dispatch/routing/mapper.rb:72:in `normalize_options!'
2011-07-06T23:12:06+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.9.1/gems/actionpack-3.0.9/lib/action_dispatch/routing/mapper.rb:55:in `initialize'
2011-07-06T23:12:06+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.9.1/gems/actionpack-3.0.9/lib/action_dispatch/routing/mapper.rb:272:in `new'
2011-07-06T23:12:06+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.9.1/gems/actionpack-3.0.9/lib/action_dispatch/routing/mapper.rb:272:in `match'
2011-07-06T23:12:06+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.9.1/gems/actionpack-3.0.9/lib/action_dispatch/routing/mapper.rb:1173:in `match'
2011-07-06T23:12:06+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.9.1/gems/actionpack-3.0.9/lib/action_dispatch/routing/mapper.rb:1360:in `match'
2011-07-06T23:12:06+00:00 app[web.1]:   from /app/config/routes.rb:84:in `block (2 levels) in <top (required)>'
2011-07-06T23:12:06+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.9.1/gems/actionpack-3.0.9/lib/action_dispatch/routing/mapper.rb:624:in `block in namespace'
2011-07-06T23:12:06+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.9.1/gems/actionpack-3.0.9/lib/action_dispatch/routing/mapper.rb:546:in `scope'
2011-07-06T23:12:06+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.9.1/gems/actionpack-3.0.9/lib/action_dispatch/routing/mapper.rb:624:in `namespace'
2011-07-06T23:12:06+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.9.1/gems/actionpack-3.0.9/lib/action_dispatch/routing/mapper.rb:1119:in `namespace'
2011-07-06T23:12:06+00:00 app[web.1]:   from /app/config/routes.rb:80:in `block in <top (required)>'
2011-07-06T23:12:06+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.9.1/gems/actionpack-3.0.9/lib/action_dispatch/routing/route_set.rb:233:in `instance_exec'
2011-07-06T23:12:06+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.9.1/gems/actionpack-3.0.9/lib/action_dispatch/routing/route_set.rb:233:in `draw'
2011-07-06T23:12:06+00:00 app[web.1]:   from /app/config/routes.rb:1:in `<top (required)>'
2011-07-06T23:12:06+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.9.1/gems/activesupport-3.0.9/lib/active_support/dependencies.rb:235:in `load'
2011-07-06T23:12:06+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.9.1/gems/activesupport-3.0.9/lib/active_support/dependencies.rb:235:in `block in load'
2011-07-06T23:12:06+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.9.1/gems/activesupport-3.0.9/lib/active_support/dependencies.rb:227:in `load_dependency'
2011-07-06T23:12:06+00:00 app[web.1]:   from <internal:lib/rubygems/custom_require>:29:in `require'
2011-07-06T23:12:06+00:00 heroku[web.1]: Process exited
2011-07-06T23:12:07+00:00 heroku[web.1]: State changed from starting to crashed
  • 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-23T13:45:51+00:00Added an answer on May 23, 2026 at 1:45 pm

    Admittedly I’m not that familiar with the match statement, but it looks like you are missing the second part of it, like:

    match ':graphs/:id(/:method)' => 'pages#something'
    

    As I see here:

    Rails routes match full hostname with multiple period in between

    and here:

    understanding rails routes: match vs root in routes.rb

    Here’s a similar issue where the action in the “to” was not properly stated.

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

Sidebar

Related Questions

I have a KML file defining several paths/routes (representing actual roads) enclosed in the
It's most common practice to register routes in Application_Start event within global.asax.cs/vb file. But
Sorry if this as already been asked. I am currently working on a small
I'm not sure if this has been asked already. Well, here is my problem.
hi have a route like this <route id=route1> <from uri=activemq:queuer1/> <choice> <when> <simple>${header.urn} regex
I have the Shovell source code from the book Simply Rails 2, but I'm
In ASP.net MVC 2, I can use routes.RouteExistingFiles = true; to send all requests
I am wondering if there is any other configuration options for a default controller.
I am new to MVC so this is my first attempt and I am
I have a custom user control (ascx) that contains a textbox and a Javascript-based

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.