Chalaka Ellawala
Chalaka Ellawala

Reputation: 435

How to call a scala.html file from a scala.html file in a different directory

I have two scala.html files.

  1. views/receivables/snippet/account_types.scala.html

  2. views/attendance/add_attendance.scala.html

If I want to call 1st scala.html file from 2nd scala.html file or the other way around, how should I call since the files are in different directories?

Upvotes: 1

Views: 594

Answers (2)

westsoldier
westsoldier

Reputation: 26

I solved this problem doing this:

I have html scala file in package views.process.popupFindProcess.scala.html

i call this file in package views.itens.createIten.scala.html adding a @import process.popupFindProcess after variable declaration in top of my scala html page and add @popupFindProcess() to include page.

Upvotes: 0

Alexander Arendar
Alexander Arendar

Reputation: 3435

I have added a package admin_views under the views package and added there a test.scala.html template. Then in one of my views from the views package I reference that other package view in this way: @views.html.admin_views.test()

Everything from under the views package is compiled to views.html so this is the reason. Thus in your case it would be views.html.receivables.snippet.account_types()

Upvotes: 1

Related Questions