cobranet
cobranet

Reputation: 119

Why this route goes to the show action

This request goes to SHOW action in Webservices controller..

 Reuest : webservices/getsomething&ids=1

This

 Reuest : webservices/getsomething

goes where I wanted at getsomething action ...
This is my route.rb :

  resources :webservices do
    collection do
      get 'getsomething'
    end
  end

rake routes :

  getsomething_webservices GET    /webservices/getsomething(.:format)              webservices#getsomething

and still rails go in show action ???

Upvotes: 0

Views: 46

Answers (2)

Michał Młoźniak
Michał Młoźniak

Reputation: 5556

You have error in your url. It should be webservices/getsomething?ids=1. Change & to ?

Upvotes: 1

user896237
user896237

Reputation:

You should try

get "getsomething/:id"

Upvotes: 1

Related Questions