Class: PagesController

Inherits:
ApplicationController show all
Defined in:
app/controllers/pages_controller.rb

Instance Method Summary collapse

Methods inherited from ApplicationController

caches_page_with_cache_marker, #raise_not_found!

Instance Method Details

#check_ipObject



23
24
25
# File 'app/controllers/pages_controller.rb', line 23

def check_ip
  render json: request.location.try(:data).try(:as_json)
end

#not_found_sampleObject



15
16
17
# File 'app/controllers/pages_controller.rb', line 15

def not_found_sample
  render_404
end

#service_unavailableObject



19
20
21
# File 'app/controllers/pages_controller.rb', line 19

def service_unavailable
  render_cached_page(503)
end

#showObject



8
9
10
11
12
13
# File 'app/controllers/pages_controller.rb', line 8

def show
  template = "pages/#{@structure.slug.gsub(/[^a-z]/, '_')}"
  template = 'pages/show' unless lookup_context.exists?(template)

  render template: template
end