0
我有以下文件:有綁定變量到HTML文件中軌的公共/目錄的方式
#{RAILS_ROOT}/public/mytemplate/index.html
它與像這樣某些類似模板的變量HTML文件:
<div class="hover">
<h1 id="user_name">{user_name}</h1>
</div>
<h2 id="project_name">{project_name}</h2>
從控制器動作,我需要使這個文件,我與
render :file => "#{RAILS_ROOT}/public/mytemplate/index.html"
做什麼,但我要地圖變量到模板值。例如,我想指定@ project.name映射到project_name。我怎樣才能指定這個映射?