开发者

Rails: load a html.haml file and render it in the view?

How to load a html.haml file from a custom class, store in a var its data, then apply some开发者_JS百科 instance variables and render it in the view?


Your description of the problem is light on details, but I think your HAML file should be a partial, and you can just use

render :partial => "<your file name>", :locals => {:foo => 'bar'}

in your view, and pass the variables you want via :locals.

There is a description of working with partials in this guide.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜