Sinatra FAQ seems to have a description
Sinatra: Frequently Asked Questions - How do I access helpers from within my views?
In hello.rb:
helpers do
defem(text)
"<em>#{text}</em>"
end
end
get'/hello'do
@subject='World'
haml —Hello
end
Views/hello.haml:
%p="Hello"+em(@subject)
915 When building Fast API+Uvicorn environment with PyInstaller, console=False results in an error
572 rails db:create error: Could not find mysql2-0.5.4 in any of the sources
581 PHP ssh2_scp_send fails to send files as intended
578 Understanding How to Configure Google API Key
574 Who developed the "avformat-59.dll" that comes with FFmpeg?
© 2024 OneMinuteCode. All rights reserved.