Class: Admin::PagesController

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

Instance Method Summary collapse

Instance Method Details

#indexObject



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

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

#newObject



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

def new
  self.model = model_class.new_with_defaults(config)
  if params[:page_id].blank?
    self.model.slug = '/'
  end
  response_for :singular
end

#showObject



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

def show
  respond_to do |format|
    format.xml { super }
    format.html { redirect_to edit_admin_page_path(params[:id]) }
  end
end