[英]Inserting variables into .html.slim file that are declared from a different directory
我是 Ruby 的新手。 我有一个 .html.slim 文件,其中包含一些我想用另一个 .rb 文件中声明的变量替换的数值。 我有这个粗略的设置:
company/app/views/landing_pages_hello/_hello.html.slim
company/lib/random/variables.rb
公司/lib/random/variables.rb
class A
MY_SALARY = 5000
end
company/app/views/landing_pages_hello/_hello.html.slim
table
tbody
tr
td
= ...
title=("My salary is $5000")
所以,我想知道我怎么取代“5000”中的_hello.html.slim
与变量文件MY_SALARY
从variables.rb
文件。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.