Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/westonganger/rails_nestable_layouts
Rails Nestable Layouts - Dead simple nested layouts for Rails
https://github.com/westonganger/rails_nestable_layouts
layout layouts nestable nestable-layouts nested-layouts rails rails-nested-layouts
Last synced: 2 months ago
JSON representation
Rails Nestable Layouts - Dead simple nested layouts for Rails
- Host: GitHub
- URL: https://github.com/westonganger/rails_nestable_layouts
- Owner: westonganger
- License: mit
- Created: 2017-02-19T02:22:29.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2024-09-01T05:13:17.000Z (4 months ago)
- Last Synced: 2024-09-30T09:41:18.473Z (3 months ago)
- Topics: layout, layouts, nestable, nestable-layouts, nested-layouts, rails, rails-nested-layouts
- Language: Ruby
- Homepage:
- Size: 19.5 KB
- Stars: 3
- Watchers: 3
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
Dead simple nested layouts support for Rails. Does not monkey patch anything. Can nest as many layouts as desired.
## Install
```ruby
gem 'rails_nestable_layouts'
```## Usage
### Your Controller
```ruby
# main layout, this line is not necessary. Note nested_layouts does not override the main layout.
layout :application# accepts the same options as before_action/before_filter
nested_layouts 'layouts/secondary_layout', 'posts/layout', except: [:index]
```### Main Layout
```erb
My Main Layout
<%= yield_nested %>
```
### Nested Layout(s)
```erbMy Nested Layout
<%= yield_nested %> # this will call the next nested layout or the requested template if no more nested layouts.
```
# Credits
Created by Weston Ganger - @westonganger