Sam Lee
Sam Lee

Reputation: 10463

Does Rails have anything like Django Rest Framework?

I come from the Django world and have found Django Rest Framework to be a useful way to make REST API's. It helps eliminate the boilerplate and comes with nice prebuilt modules for auth, serialization, etc.

I'm wondering if Rails has anything similar?

Upvotes: 6

Views: 2177

Answers (2)

Greg Schmit
Greg Schmit

Reputation: 4594

Disclosure: I am promoting a gem that I authored.

I am a software engineer who loves Python/Django but who has worked with Ruby on Rails for about 5 years; recently, I wrote a gem called Rails REST Framework. The core goal is to provide similar base functionality as DRF, namely:

  • ModelControllerMixin (analogous to ModelViewSet), which allow controllers to include the common CRUD actions and api_response renderer.
  • Routers, which allow routing to actions which are defined on Controllers.
  • Serializers (mainly the NativeModelSerializer, which allow you to define fields, ignore/exclude fields, methods, and associations/relations).
  • Browsable APIs (included with the ModelControllerMixin) allow your APIs to be browsable (and the theme I kinda shamelessly stole from DRF).

Upvotes: 1

Chuan
Chuan

Reputation: 3453

Rails 5 has the new feature API mode, could fit your needs. Check more from here.

Upvotes: 4

Related Questions