samedi 23 juin 2018

What is the difference between Api in Controller and another folder in rails?

What is the difference between Api in Controller and another folder in rails ?

class PostsController < ApplicationController 
        def index
            posts = Post.all
            render json: {status: 'SUCCESS', message: 'Loaded all posts', data: posts}, status: :ok
        end 
end

and use Api version

-Controller |
             -- api|
                    --v1

and which best or use it

Aucun commentaire:

Enregistrer un commentaire