Class: Ishapi::MapsController
Instance Method Summary
collapse
#home, #long_term_token, #vote
Instance Method Details
#show ⇒ Object
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
# File 'app/controllers/ishapi/maps_controller.rb', line 7
def show
@location = ::Gameui::Map.where( slug: params[:slug] ).first
@location ||= ::Gameui::Map.find params[:slug]
@map = @location.map || @location
authorize! :show, @map
@newsitems = @location.newsitems.page( params[:newsitems_page]
).per( @location.newsitems_page_size )
@markers = @map.markers.permitted_to(@current_user.profile).order_by(ordering: :asc)
@tags = @map.tags
if @map.is_premium && !@current_user.profile.has_premium_purchase( @map )
render 'show_restricted'
else
render 'show'
end
end
|
#show_marker ⇒ Object
36
37
38
39
40
|
# File 'app/controllers/ishapi/maps_controller.rb', line 36
def show_marker
@marker = ::Gameui::Marker.find_by slug: params[:slug]
authorize! :show, @marker
render json: @marker
end
|