Add specs for api/v1/rooms_controller & api/v1/tracks_controller
and cleanup api/v1/tracks and api/v1/rooms controllers
This commit is contained in:
parent
55cfc8ff60
commit
864245fec2
4 changed files with 77 additions and 5 deletions
|
|
@ -5,12 +5,11 @@ module Api
|
|||
respond_to :json
|
||||
|
||||
def index
|
||||
if params[:conference_id].blank?
|
||||
rooms = Room.all
|
||||
if @conference
|
||||
respond_with @conference.venue ? @conference.venue.rooms : Room.none
|
||||
else
|
||||
@conference.venue ? (rooms = @conference.venue.rooms) : (rooms = [])
|
||||
respond_with Room.all
|
||||
end
|
||||
respond_with rooms
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue