I’ve just got started with Play2 and I’m struggling with scala.
In a view I’ve got this simple form helper to create a news item.
@textarea(
newsItemForm("content"),
'_label -> "Content",
'rows -> 3,
'cols -> 50,
)
Now I’d like to add a data-wysiwyg to the attributes, but since it contains a – scala complains about – not being a member of Symbol.
since ' is just a nice way of writing Symbol(“data-wysiwyg”) I can get it working, but then my views will look ugly with some attributes beeing specified with Symbol and others with '
My question is: is there a way to use the scala ' notation for html5 data- attributes?
I don’t think it’s possible because the dash will be interpreted as a minus sign. If the matter is to shorten the declaration, why not add a method
sto strings to produce the corresponding symbol (akin to thermethod for producing regexp) ?