3

I have a Rails web app and I want to provide API. I have found Grape and it looked nice and it can also be mounted into Rails but I am not sure of benefits of mounting Grape into my Rails app and use it for API instead of Rails controllers.

As I understand Grape is great for building applications that provide only API but it is not my case.

What do you think are the benefits of using Grape in the Rails app and why should I do so?

Tomáš Linhart
  • 13,509
  • 5
  • 51
  • 54
  • SO isn't the place to ask open-ended questions like this that are likely to receive opinionated answers. – deefour Feb 20 '13 at 22:53
  • I want a list of benefits. True facts why Grape is better than Rails for API if I use already Rails. I don't consider this question to be open-ended. – Tomáš Linhart Feb 20 '13 at 23:10

1 Answers1

1

Grape within Rails makes it easy to standardize the syntax of your API.

For example, parameter validation and coercion, error handling specific to your API that's different than what Rails provides out of the box, and easy shortcuts for typical responses.

You could do all this with Rails, of course. Grape just makes it easy.

joelparkerhenderson
  • 34,808
  • 19
  • 98
  • 119