Class: Admin::PagesController

Inherits:
ResourceController
  • Object
show all
Defined in:
app/controllers/admin/pages_controller.rb

Defined Under Namespace

Classes: PreviewStop

Instance Method Summary collapse

Instance Method Details

#indexObject



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

def index
  @homepage = Page.find_by_parent_id(nil)
  response_for :plural
end

#newObject



28
29
30
31
32
# File 'app/controllers/admin/pages_controller.rb', line 28

def new
  @page = self.model = model_class.new_with_defaults(trusty_config)
  assign_page_attributes
  response_for :new
end

#previewObject



34
35
36
37
38
# File 'app/controllers/admin/pages_controller.rb', line 34

def preview
  render_preview
rescue PreviewStop => exception
  render :text => exception.message unless @performed_render
end