Add route to get all raids
This commit is contained in:
parent
3cb18aa8ef
commit
edf489ce31
4 changed files with 21 additions and 0 deletions
6
app/controllers/api/v1/raids_controller.rb
Normal file
6
app/controllers/api/v1/raids_controller.rb
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
class Api::V1::RaidsController < Api::V1::ApiController
|
||||
def all
|
||||
@raids = Raid.all()
|
||||
render :all, status: :ok
|
||||
end
|
||||
end
|
||||
3
app/views/api/v1/raids/all.json.rabl
Normal file
3
app/views/api/v1/raids/all.json.rabl
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
collection @raids
|
||||
|
||||
extends 'raids/base'
|
||||
10
app/views/api/v1/raids/base.json.rabl
Normal file
10
app/views/api/v1/raids/base.json.rabl
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
object :raid
|
||||
|
||||
attributes :id, :level, :group
|
||||
|
||||
node :name do |r|
|
||||
{
|
||||
:en => r.name_en,
|
||||
:jp => r.name_jp
|
||||
}
|
||||
end
|
||||
|
|
@ -20,6 +20,8 @@ Rails.application.routes.draw do
|
|||
get 'search/weapons', to: 'search#weapons'
|
||||
get 'search/summons', to: 'search#summons'
|
||||
|
||||
get 'raids', to: 'raids#all'
|
||||
|
||||
post 'characters', to: 'grid_characters#create'
|
||||
post 'characters/update_uncap', to: 'grid_characters#update_uncap_level'
|
||||
delete 'characters', to: 'grid_characters#destroy'
|
||||
|
|
|
|||
Loading…
Reference in a new issue