Last active
December 10, 2015 16:08
-
-
Save jhoffner/4459023 to your computer and use it in GitHub Desktop.
A clean way to specify layout options for your rails options
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ApplicationController | |
helper_method :layout_options | |
def layout_options(options = nil) | |
@layout_options ||= Hashie::Mash.new( | |
title: "Default App Title", | |
menubar: true, | |
footer: true, | |
og_title: nil, | |
og_type: 'website', | |
og_description: nil | |
) | |
@layout_options.merge!(options) if options | |
@layout_options | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment