Im realy sorry to ask this when there are a lot of similar posts but none seams to work for me.
/app/controllers/api/v1
class Api::V1::MusicsController < ApplicationController
def index
articles = Article.order('created_at DESC');
render json: {status: 'SUCCESS', message:'Loaded articles', data:articles},status: :ok
end
end
routes.rb
Rails.application.routes.draw do
namespace 'api' do
namespace 'v1' do
resources :music
end
end
end
Aucun commentaire:
Enregistrer un commentaire