0.0
Repository is archived
No commit activity in last 3 years
No release in over 3 years
Need an easy way to manage multiple layouts? Done.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 1.0.0.rc.6
~> 2.1.0
~> 2.1.0
~> 0.11.6

Runtime

>= 3.0.1
 Project Readme

layout_options

The layout_options gem provides a single place to set all of your layouts in
your controller. This gem really shines when using inherited_resources and
you need multiple layouts.

This gem came from that exact scenario.

Usage

To add layout_options to your Rails project and type ‘rails generate layout_options:install’

Example

Adding layout_options to your Gemfile:

gem 'layout_options', '~> 0.1'

Install layout_options:

rails generate layout_options:install

Define your layouts in your controllers:


  class UsersController < ApplicationController
    layout_options :overlay => [:new, :edit], :none => :destroy
    # use :none for your hash key if you don't want any layout to be used
  end

Thats it!

Want to test it?

layout_options requires a rails instance so you’ll need to run RSpec from within the spec/rails_root directory.

Run: bundle exec rspec -Ispec/rails_root/spec spec/rails_root/spec