Last active
August 29, 2015 14:14
-
-
Save maxim/4068bf30d8efef563ce4 to your computer and use it in GitHub Desktop.
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 :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