focused_controller icon indicating copy to clipboard operation
focused_controller copied to clipboard

Respond with 404 when there is no matching FC class

Open eugenebolshakov opened this issue 12 years ago • 6 comments

When an ActionController method that corresponds to the URL is missing, it throws an ActionNotFound exception and a custom error page is rendered. This is helpful in production. Do you think something similar should happen in FC too?

eugenebolshakov avatar Jan 07 '13 15:01 eugenebolshakov

Yes, I reckon so.

jonleighton avatar Jan 08 '13 18:01 jonleighton

Just remembered about this and even created a patch, but then realized that it's not an issue if available actions are specified via only and except options on resources because in that case rails already returns 404.

eugenebolshakov avatar Mar 23 '13 15:03 eugenebolshakov

Yeah, proper use of only and except prevents this, but I still think it would be nice to return a 404 by default rather than the "constant not found" error we get at the moment.

jonleighton avatar Mar 23 '13 19:03 jonleighton

Would be good to see the patch if you've written it anyway!

jonleighton avatar Mar 23 '13 19:03 jonleighton

Cool, attached the patch.

eugenebolshakov avatar Mar 24 '13 16:03 eugenebolshakov

Sweet, patch looks good but the build seems to be broken: https://travis-ci.org/jonleighton/focused_controller/builds/5760415 any ideas?

jonleighton avatar Mar 24 '13 20:03 jonleighton