Sha256: 7d7187d9a916dab69ea862c3d2f42a19d3f553387716d1c30c047909a396052e

Contents?: true

Size: 459 Bytes

Versions: 8

Compression:

Stored size: 459 Bytes

Contents

require_dependency "jobshop/application_controller"

module Jobshop
  class PagesController < ApplicationController
    def show
      page = valid_page? ? [ template: current_page ]
                         : [ file: "public/404.html", status: :not_found ]
      render(*page)
    end

    private

    def valid_page?
      lookup_context.template_exists?(current_page)
    end

    def current_page
      "jobshop/pages/#{params[:page]}"
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
jobshop-0.0.4.2p4 app/controllers/jobshop/pages_controller.rb
jobshop-0.0.4.1p4 app/controllers/jobshop/pages_controller.rb
jobshop-0.0.4.0p13 app/controllers/jobshop/pages_controller.rb
jobshop-0.0.4.0p1 app/controllers/jobshop/pages_controller.rb
jobshop-0.0.3.1 app/controllers/jobshop/pages_controller.rb
jobshop-0.0.3.0 app/controllers/jobshop/pages_controller.rb
jobshop-0.0.2.6 app/controllers/jobshop/pages_controller.rb
jobshop-0.0.2.5 app/controllers/jobshop/pages_controller.rb