Class: Bhf::PagesController

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

Instance Method Summary collapse

Methods inherited from ApplicationController

#index

Instance Method Details

#showObject



4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'app/controllers/bhf/pages_controller.rb', line 4

def show
  @edit_params = {}
  unless platform_options = @settings.content_for_page(@page)
    raise Exception.new("Page '#{@page}' could not be found")
  end

  if request.xhr?
    params.each do |key, value|
      return render_platform(key) if value.is_a?(Hash)
    end
  end

  @platforms = platform_options.each_with_object([]) do |opts, obj|
    platform = find_platform(opts.keys[0])
    
    next if platform.table_hide?
    paginate_platform_objects(platform)
    obj << platform
  end
end