mschae / trailing_format_plug

An elixir plug to support legacy APIs that use a rails-like trailing format: http://api.dev/resources.json
25 stars 15 forks source link

Not working for collection actions #5

Open zaidakram opened 8 years ago

zaidakram commented 8 years ago

My routes are like this

scope "/", PostPhoenix do
  pipe_through :api

  scope "v1" do
    resources "posts", PostController, only: [:index, :show]
    post "posts/search", PostController, :search
  end
end

member routes are working fine like

/v1/posts/3.json

But it doesn't work on collection actions. Like this

/v1/posts.json
mschae commented 8 years ago

Sorry about that. Let me look into that, it works fine for us. Maybe a new version of plug works differently or it is specific to your setup. Can you share an example project somewhere?