`respond_to` without all the pain
When you generate a scaffold in Rails, you’ll see the usual respond_to
blocks. But some of your actions, like index
, don’t have them. And those actions, when hit with a bad format, will raise the wrong kind of error. You want to handle bad formats correctly, but littering all your controllers with big respond_to
blocks is crazy. It feels un-Rails-ish. So what do you do?
Post a comment