Skip to content

Instantly share code, notes, and snippets.

@jhoffner
Last active December 10, 2015 16:08
Show Gist options
  • Save jhoffner/4459023 to your computer and use it in GitHub Desktop.
Save jhoffner/4459023 to your computer and use it in GitHub Desktop.
A clean way to specify layout options for your rails options
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