Sha256: 46efa48916f70c62cfbe2c344ab37a586135025df62edb920464e87b627ff68c

Contents?: true

Size: 621 Bytes

Versions: 2

Compression:

Stored size: 621 Bytes

Contents

require "prosperity/engine"
require "prosperity/main_app_route_delegator"

module Prosperity
  mattr_accessor :parent_controller
  self.parent_controller = 'ActionController::Base'

  mattr_accessor :parent_layout
  self.parent_layout = 'prosperity/base'

  class << self
    def layout=(layout)
      self.parent_layout = layout
      if layout && layout !~ %r(^prosperity/)
        # inline application routes if using an app layout
        inline_main_app_routes!
      end
    end

    def inline_main_app_routes!
      ::Prosperity::ApplicationController.helper ::Prosperity::MainAppRouteDelegator
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
prosperity-0.0.11 lib/prosperity.rb
prosperity-0.0.10 lib/prosperity.rb