jonleighton / focused_controller

MIT License
468 stars 27 forks source link

Respond with 404 when there is no matching FC class #24

Open eugenebolshakov opened 11 years ago

eugenebolshakov commented 11 years ago

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?

jonleighton commented 11 years ago

Yes, I reckon so.

eugenebolshakov commented 11 years ago

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.

jonleighton commented 11 years ago

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 commented 11 years ago

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

eugenebolshakov commented 11 years ago

Cool, attached the patch.

jonleighton commented 11 years ago

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