Play2 form attributes with - in them "value - is not a member of Symbol"
playframework, playframework-2.0, scala
Solution
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 `s` to strings to produce the corresponding symbol (akin to the `r` method for producing regexp) ?
class SymbolString( str: String ) {
def s = Symbol(str)
}
implicit def str2symstr( str: String ) = new SymbolString(str)
scala> "hello".s
res20: Symbol = 'hello
scala> "data-wysiwyg".s
res21: Symbol = 'data-wysiwyg
Problem
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?