Sha256: 7b236da5b5fc91a2158aea57285b4fd9a2a677ac41eb7e3ca9eea183d2fd1dd0
Contents?: true
Size: 1009 Bytes
Versions: 8
Compression:
Stored size: 1009 Bytes
Contents
require_dependency "ishapi/application_controller" module Ishapi class MapsController < ApplicationController before_action :check_profile, only: [ :show ] def show @map = ::Gameui::Map.find_by slug: params[:slug] @markers = @map.markers.where( is_active: true ) @newsitems = @map.newsitems 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 ## @TODO: figure this out eventually 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 def show_marker @marker = ::Gameui::Marker.find_by slug: params[:slug] authorize! :show, @marker render json: @marker end end end
Version data entries
8 entries across 8 versions & 1 rubygems