capiCrimm asked:

Template Location for Multiple Controllers

If I have nitro mapping to multiple controllers how should I set up the corrosponding .xhtml files in the template folder?

(2 attempts)

capiCrimm answered:

You add your .xhtml files to match your controller mappings. Id est, if you have ClassA'' mapped to the url/A'', then you would place the *.xhtml files for ClassA'' in template.root +/A''

Rating: 4

Kashia answered:

This depends on how you mapped your controllers. (Although there are other hidden mechanisms to control this)

run.rb

# ..
Nitro::Template.root = 'templates'

Nitro::Server.map = {
  '/' => IndexController,
  '/users' => UserController,
# .. 

If you do this, the following convention will kick in:

The xhtml files in templates/ will belong to the IndexController, while templates/users/ will be used to look up the templates for the UserController.

$ cd $nitro_app
$ cd templates
$ ls 
users
index.xhtml

Rating: 4