I have a bunch of methods like this in view helper
def background
"#e9eaec"
end
def footer_link_color
"#836448"
end
I’d like these methods exposed to the view, but I’d prefer the helper to be a bit more concise. What’s the best way to turn a hash, say, into methods (or something else)?
Though I don’t think trading this bit of conciseness for the readability of your first approach is necessarily a good idea.
If you want to generalize this, you can add the following method to the Module class:
And then in your helper call
methods_from_hash(:background => ...).