0

I try to use FOSRestBundle but gets error:

No route found for "GET /en/users"

Here is controller action:

public function getUsersAction()
{
    return new Response('resting');
}

Here is config in app/config/routin.yml:

geekhub_main:
  resource: "@GeekhubMainBundle/Resources/config/routing.yml"
  prefix:   /{_locale}
  requirements:
    _locale: |uk|en
  defaults: { _locale: en }

Here is config in MainBundle/Resources/config/routing.yml

users:
type:     rest
resource: Geekhub\MainBundle\Controller\UsersController

Here is config for the rest:

fos_rest:
format_listener: true
routing_loader:
    default_format: json
view:
    view_response_listener: true
    formats:
        json: true
        xml: true
        yml: true

Route debug display:

 get_users                GET    ANY    ANY  /{_locale}/users.{_format}                     
 get_user                 GET    ANY    ANY  /{_locale}/users/{slug}.{_format} 

What I am doing wrong ?

nowiko
  • 2,507
  • 6
  • 38
  • 82

1 Answers1

1

Do you not need to include your format? So /en/users.json?

Ewan Valentine
  • 3,741
  • 7
  • 43
  • 68
  • 1
    if format dont assigned evidently it will be in .json format by defalut! but your advice has the right to life :) – nowiko Jan 19 '15 at 13:48