Skip to content

Instantly share code, notes, and snippets.

@maxim
Last active August 29, 2015 14:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save maxim/4068bf30d8efef563ce4 to your computer and use it in GitHub Desktop.
Save maxim/4068bf30d8efef563ce4 to your computer and use it in GitHub Desktop.
class ApplicationController
helper_method :current_copywriting
def current_copywriting
@current_copywriting ||= Copywriting.find_by_request(request)
end
end
module SomeHelpers
def header_text
current_copywriting ? current_copywriting.header_text : "default text"
end
def meta_keywords
if current_copywriting
current_copywriting.meta_keywords
else
["default", "keywords"]
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment