Class: Ishapi::MapsController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- Ishapi::MapsController
- Defined in:
- app/controllers/ishapi/maps_controller.rb
Instance Method Summary collapse
Methods inherited from ApplicationController
Instance Method Details
#index ⇒ Object
7 8 9 10 |
# File 'app/controllers/ishapi/maps_controller.rb', line 7 def index :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 :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] :show, @marker render json: @marker end |