Sha256: 7c6da6e9184315202cbb7b1df66d9d5a4cf960444d749279e94997ad8d7b01dc

Contents?: true

Size: 1.38 KB

Versions: 2

Compression:

Stored size: 1.38 KB

Contents

load File.join(Gem.loaded_specs['forgeos_core'].full_gem_path, 'app', 'controllers', 'forgeos', 'application_controller.rb')

Forgeos::ApplicationController.class_eval do
  include RoutesHelper

  private

  def page_not_found
    if @page = Page.find_by_single_key(404)
      return render(@page, :layout => true, :status => 404)
    else
      return render(:text => (I18n.t('page_not_found') || 'page not found'), :layout => false, :status => 404)
    end
  end

  def render_optional_error_file(status_code)
    status = interpret_status(status_code)
    locale_path = "#{Rails.public_path}/#{status[0,3]}.#{I18n.locale}.html" if I18n.locale
    cached_path = "#{Rails.configuration.action_controller.page_cache_directory}/#{status[0,3]}.html" if Rails.configuration.action_controller.page_cache_directory
    path = "#{Rails.public_path}/#{status[0,3]}.html"

    if locale_path && File.exist?(locale_path)
      render :file => locale_path, :status => status, :content_type => Mime::HTML
    elsif cached_path && File.exist?(cached_path)
      render :file => cached_path, :status => status, :content_type => Mime::HTML
    elsif File.exist?(path)
      render :file => path, :status => status, :content_type => Mime::HTML
    else
      head status
    end
  end
end

# Rails Bug fix on Nested inheritance models : Load nested models to use it parent class
Carousel
WidgetActuality
WidgetFaq
LinkPage

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
forgeos_cms-1.9.4 app/controllers/forgeos/application_controller.rb
forgeos_cms-1.9.2 app/controllers/forgeos/application_controller.rb