kurenn / sabisu-rails

Simple and powerful engine for exploring your Rails api application
MIT License
127 stars 29 forks source link

Routing Error: No route matches [GET] "/users" #32

Closed dgoradia closed 9 years ago

dgoradia commented 9 years ago

But I do have routes.

Routing Error
No route matches [GET] "/users"

Rails.root: /Users/dgoradia/ror-api-demo

Application Trace | Framework Trace | Full Trace
Routes

Routes match in priority from top to bottom

You don't have any routes defined!

Please add some routes in config/routes.rb.
For more information about routes, please see the Rails guide Rails Routing from the Outside In.

config/routes.rb

require 'api_constraints'

Rails.application.routes.draw do
  mount SabisuRails::Engine => "/sabisu_rails"
  devise_for :users
  # API namespace
  namespace :api, defaults: { format: :json }, constraints: { subdomain: 'api' }, path: '/' do
    scope module: :v1, constraints: ApiConstraints.new(version: 1, default: true) do

      resources :users, :only => [:show, :create, :update, :destroy]

    end
  end
end
kurenn commented 9 years ago

You sure you are on the directory?, if yes probably you will have to configure sabisu to something like: https://github.com/IcaliaLabs/sabisu-rails#customization

Another question, are you using a multithread server like Puma or Unicorn?

dgoradia commented 9 years ago

Sorry for such a late response, I missed the notification.

I'm don't know what you mean by "You sure you are on the directory?".

My config:

SabisuRails.setup do |config|

  # Base uri for posting the
  config.base_api_uri = 'api.my-test-app.dev'

  config.api_headers = { "Accept" => "application/vnd.my-test-app.v1" }

  # Resources on the api
  config.resources = [:users, :products]
  config.default_resource = :users

end

No, I'm using rails server.

dgoradia commented 9 years ago

Sorry, my mistake. I don't have an index method for users controller which is why I get the message.

kurenn commented 8 years ago

Ok, no worries! =) Happy you got it to work!