[Nitro] Difference between /account and /account/ ???
Thomas Leitner
t_leitner at gmx.at
Tue Sep 18 05:44:38 EDT 2007
Hi everybody,
I have a problem with the repo version of nitro. I have the following
controller in app/controller/account.rb:
class Account::Controller
include FormHelper
def index(*args)
p 'in index'
@accounts = Account.all
end
end
where Account is a model object and the following app/template/
account/index.htmlx file:
<Page>
<?r p @accounts ?>
<?r accounts = @accounts ?>
<?include href="/account/list" ?>
</Page>
and app.rb as follows:
#!/usr/bin/env ruby
$DBG = true
require 'nitro_and_og';
include Nitro
require 'nitro/part/admin'
require 'app/setup' # includes all controllers and models
require 'app/skin' # defines the Page element
app = Application.new
app.dispatcher.root = Manager
app.dispatcher.root.account = Account
app.start
The problem is that when navigating to /account everything works just
fine and I get a list of my accounts. However, when using /account/
the Account::Controller#index method does not seem to be called which
results in the @accounts variable not being correctly initialized and
an error afterwards.
Any ideas why this is so? Kashia suggested on #nitro that this may be
a bug?!
Thanks for the help,
Thomas
More information about the Nitro-general
mailing list