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