citizenry icon indicating copy to clipboard operation
citizenry copied to clipboard

Unable to retrieve format-specific version of a resource (e.g. /people/1471.json)

Open hackervera opened this issue 13 years ago • 2 comments

no .json resource http://epdx.org/people/1471.json

hackervera avatar Dec 22 '11 22:12 hackervera

Duplicate of https://github.com/reidab/citizenry/issues/62

LeifWarner avatar Dec 22 '11 22:12 LeifWarner

Thanks for filing this report. I can confirm this is a problem for all our controllers, not just people. I've updated the title to clear this up.

I'm certain that this feature used to work. I've reviewed our routes and the respond_to code declaring this functionality, and they look fine. We haven't touched the code declaring this in a long time, so I don't think we broke it. My theory is this is a problem caused by a newer version of Rails or inherited_resources.

When I stepped through the code with a debugger, I found that requesting a format-specific path (e.g. /foo/123.json) would cause the system to redirect to a generic path (e.g. /foo/123) before the controller's show action was called, so I can't even provide an easy workaround.

If someone has some time to dig through the inherited_resources library, I'd appreciate it. I'd recommend reading through it to figure out how it implements the show action and how this handles the respond_to information, because I believe the problem is there.

igal avatar Dec 23 '11 00:12 igal