RubyFlow The Ruby and Rails community linklog

×

The Ruby and Rails community linklog

Made a library? Written a blog post? Found a useful tutorial? Share it with the Ruby community here or just enjoy what everyone else has found!

'render' is not your final word in your Rails controller's action

https://blog.arkency.com/render-is-not-your-final-word-in-your-rails-controllers-action/

Suppose you are using some library that performs some logic in your controller and render some templates once some invariants are not met. Assume the library is old and was created once you were not using JSON API but was only rendering HTML templates. Now you need to add similar logic to your API controller. You may think that you should now modify the library to handle JSON responses, but that’s not the only solution you can use.

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