问题
How can helpers be accessed from middleman console
? Answer for both 3.x and 4.x would be helpful if it's not the same object path.
回答1:
I couldn't find any documentation on this, so settled for the following work around:
Here's my helper
module PageHelpers
def thing
"THING!"
end
end
Call the helper method on an instance of a class that includes it:
$ bundle exec middleman console
irb...> (class Thing; include PageHelpers; end).new.thing
=> "THING!"
来源:https://stackoverflow.com/questions/42144577/how-can-helpers-be-accessed-from-middleman-console