在 haml 文件中将 ruby 参数连接到对象 ID?
我在 Rails 上使用 ruby。
这是我的“视图”代码(file.haml)的一部分:
%div#all_ads
- @ads.each_with_index do |ad,index|
%div#campaign_ads
我想将索引连接到div id。
像 %div#campaign_ads+index
的
语法必须是什么?
I work with ruby on rails.
this is part of my 'view' code (file.haml):
%div#all_ads
- @ads.each_with_index do |ad,index|
%div#campaign_ads
I want to concatenate the index to the div id.
something like %div#campaign_ads+index
what have to be the syntax?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
像这样的东西:
Something like this: