How to create restful api in ruby on rails?

does rails route provide same architecture as restful api has?

As an advice. When you’ll make a decision which technique to use take also look into grape gem.

Hi woto,

i need to implement in rails

thanks

Ok. Then yes Rails Routing from the Outside In — Ruby on Rails Guides

@rails6learner Reading a book is definitely good advice, but to clarify: Rails is one way to build a REST API. You could also use Rails to build other APIs (such as GraphQL or websockets-based). REST, however, is probably the biggest way that people have made APIs in Rails historically, so Rails definitely works for that.

grape is a gem which can work along with Rails (it can work with other frameworks too). I also recommend checking it out to maybe make things simpler

Not by itself but yes you can create RESTful APIs with RAILS. That requires from you that you set up your application in such a way that the data can be accessed as resources and that you create controllers that provide an API in a RESTful way. That said you do get a lot of support from RAILS.

You are shipping features gradually.

  1. Step 1: Create Rails API Skeleton.
  2. Step 2: Versioning your api.
  3. Step 3: Scaffold a resource.
  4. Step 4: Move the resource controller to its respective folder.
  5. Step 5: Update The controller.
  6. Step 6: Update the route file.
  7. Step 7: More resources.
  8. Step 8 : Try it! MyFordBenefits