Class: Hyrax::PagesController

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

Overview

Shows the about and help page

Instance Method Summary collapse

Instance Method Details

#editObject



13
14
15
16
17
18
# File 'app/controllers/hyrax/pages_controller.rb', line 13

def edit
  add_breadcrumb t(:'hyrax.controls.home'), root_path
  add_breadcrumb t(:'hyrax.dashboard.breadcrumbs.admin'), hyrax.dashboard_path
  add_breadcrumb t(:'hyrax.admin.sidebar.configuration'), '#'
  add_breadcrumb t(:'hyrax.admin.sidebar.pages'), hyrax.edit_pages_path
end

#showObject



9
10
11
# File 'app/controllers/hyrax/pages_controller.rb', line 9

def show
  @page = ContentBlock.for(params[:key])
end

#updateObject



20
21
22
23
24
25
26
27
28
# File 'app/controllers/hyrax/pages_controller.rb', line 20

def update
  respond_to do |format|
    if @page.update(value: update_value_from_params)
      format.html { redirect_to hyrax.edit_pages_path, notice: t(:'hyrax.pages.updated') }
    else
      format.html { render :edit }
    end
  end
end