Class: FestivityLocationsController

Inherits:
ApplicationController
  • Object
show all
Includes:
Concerns::FestivityCustomPage
Defined in:
app/controllers/festivity_locations_controller.rb

Instance Method Summary collapse

Instance Method Details

#showObject



4
5
6
7
8
9
10
11
12
13
14
15
# File 'app/controllers/festivity_locations_controller.rb', line 4

def show
  @location = FestivityLocationPage.find_by_slug_for_site(params[:id]).first
  if @location
    @location_events = @title = Rails.cache.fetch("location-#{@location.slug}", expires_in: 2.hours) do
      FestivityEventList.find_by_location(@location.id, current_site)
    end
    @title = "#{current_site.festivity_festival_name}: #{@location.title}"
  else
    file_not_found_for_site
  end

end