RubyFlow The Ruby and Rails community linklog

`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

You can use basic HTML markup (e.g. <a>) or Markdown.

As you are not logged in, you will be
directed via GitHub to signup or sign in