Class: Ishapi::MapsController
Instance Method Summary
collapse
#home, #long_term_token, #test
Instance Method Details
#index ⇒ Object
7
8
9
10
|
# File 'app/controllers/ishapi/maps_controller.rb', line 7
def index
authorize! :index, ::Gameui::Map
@maps = ::Gameui::Map.all
end
|
#show ⇒ Object
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
# File 'app/controllers/ishapi/maps_controller.rb', line 12
def show
@map = ::Gameui::Map.find_by slug: params[:slug]
@markers = @map.markers.where( is_active: true )
case @map.ordering_type
when ::Gameui::Map::ORDERING_TYPE_ALPHABETIC
@markers = @markers.order_by( name: :asc )
when ::Gameui::Map::ORDERING_TYPE_CUSTOM
@markers = @markers.order_by( ordering: :asc )
end
if city = City.where( cityname: @map.slug ).first
@newsitems = city.newsitems
@galleries = city.galleries
@reports = city.reports
@videos = city.videos
end
authorize! :show, @map
end
|
#show_marker ⇒ Object
32
33
34
35
36
|
# File 'app/controllers/ishapi/maps_controller.rb', line 32
def show_marker
@marker = ::Gameui::Marker.find_by slug: params[:slug]
authorize! :show, @marker
render json: @marker
end
|