Support function to call a frame call from another template

I have a utility file utils.scala.html that looks like this:

@renderTableRow(columnTag: String, columns: Seq[String]) = {
<tr>
@for(column <- columns) {
    <@columnTag>
        @column
    </@columnTag>
}
</tr>
}

I want to call this helper function from the rest of my view files to create table headers.

@import views.html.mycommon.utils

@renderQuotesTable() = {
<table class="table table-bordered table-striped">
  <thead>
       @utils.renderTableRow("th", Seq("Name", "Date of Birth", "Age"))
  </thead>
  <tbody>
  </tbody>

}

But I get the following error message

The renderTableRow value is not a member of the views.html.mycommon.utils object.

What am I missing here?

+4
source share
1 answer

. sbt doc Scala Doc renderTableRow util. "renderTableRow" apply, : "target/scala -2.10/src_managed/main/views/html/mycommon/utils.template.scala".

, , Scala singleton.

+1

All Articles