ruby on rails - Give a 404 instead of a 500 error for missing templates -
i have rails 3.0 app (working on 3.2 upgrade) , whenever requests template doesn't exist gives 500 error in production. instance mysite.com/blog_posts/532 sends post id 532 html no problem, if reason mysite.com/blog_posts/532.txt requested, app raises 500 actionview::missingtemplate error. this shouldn't happen, because template shouldn't there in first place. should more 404 error, or perhaps show html template. how can make app either show 404 error missing-template errors, or show default html template instead of giving 500? log: started "/blog_posts/73.txt" 127.0.0.1 @ 2013-05-20 21:22:51 -0400 processing blogpostscontroller#show text parameters: {"id"=>"73"} pk , serial sequence (2.0ms) select attr.attname, seq.relname pg_class seq, pg_attribute attr, pg_depend dep, pg_namespace name, pg_constraint cons seq.oid = dep.objid , seq.relkind = 's' , attr.attrelid = dep.refobjid , attr.attnum = dep.refobjs...