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



21
22
23
24
# File 'app/controllers/admin/pages_controller.rb', line 21

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

#newObject



26
27
28
29
30
# File 'app/controllers/admin/pages_controller.rb', line 26

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

#previewObject



32
33
34
35
36
# File 'app/controllers/admin/pages_controller.rb', line 32

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