在html class =“"中插入ruby "财产 [英] Insert ruby in html class=" " property

查看:99
本文介绍了在html class =“"中插入ruby "财产的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这可能真的很愚蠢,但是我花了最后两个小时来尝试如何做到这一点.

This is probably really stupid but I've spent the last 2 hours trying to figure out how to do this with no luck at all.

基本上,我需要html页面才能执行以下操作:

Basically I need my html page to do the following:

<div class="circleElement">
...
</div>

但是我需要使用ruby将更多的类添加到该div类中,这些类来自数据库中的文本字段.

But I need to add more classes to that div class with ruby, the classes are coming in from a text field in my database.

我尝试插入红宝石,如下所示:

I tried inserting ruby like:

<div class="circleElement"+ <%= u.tag %> >...</div>

此行的许多变化形式都没有运气:(

And many different variations of this line with no luck at all :(

我应该补充一点,u.tag完全包含此字符串>"activeTag classicTag" ....因此它应该没有问题地追加,但是它没有这样做!

I should add that u.tag holds exactly this string> "activeTag classicTag".... so it should append with no problems but it's not doing it!

推荐答案

<div class="circleElement <%= u.tag %>" >...</div>

应该工作.

这篇关于在html class =“"中插入ruby &quot;财产的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆