Module: LayoutOptions
- Defined in:
- lib/layout_options/storage.rb,
lib/layout_options/version.rb,
lib/layout_options/layout_options.rb,
lib/generators/layout_options/install_generator.rb
Defined Under Namespace
Modules: ClassMethods, Generators, InstanceMethods Classes: Storage
Constant Summary collapse
- VERSION =
'0.2.2'
- @@default_layout =
'application'
Class Method Summary collapse
-
.included(controller) ⇒ Object
:nodoc:.
-
.setup {|_self| ... } ⇒ Object
setup - This method allows you to configure the layout_options gem.
Class Method Details
.included(controller) ⇒ Object
:nodoc:
5 6 7 8 9 |
# File 'lib/layout_options/layout_options.rb', line 5 def self.included(controller) # :nodoc: controller.send(:include, LayoutOptions::InstanceMethods) controller.send(:extend, LayoutOptions::ClassMethods) controller.send(:layout, :layout_options_selector) end |
.setup {|_self| ... } ⇒ Object
setup - This method allows you to configure the layout_options gem. You can find the setup block in the config/initializers/layout_options.rb file.
# layout_options assumes the default layout for all of your views is 'application'. If you
# want to deviate from this assumption you can set a 'default_layout' value.
LayoutOptions.setup do |config|
config.default_layout = :custom_layout
end
20 21 22 |
# File 'lib/layout_options/layout_options.rb', line 20 def self.setup yield(self) end |