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



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

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



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

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

#updateObject



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

def update
  respond_to do |format|
    if @page.update(value: update_value_from_params)
      redirect_path = "#{hyrax.edit_pages_path}##{params[:content_block].keys.first}"
      format.html { redirect_to redirect_path, notice: t(:'hyrax.pages.updated') }
    else
      format.html { render :edit }
    end
  end
end