I’m trying to specify a model in a controller, but rails gives me
“Account is not a class”, where Account is my model name …
This is my model:
class Account < ActiveRecord::Base
validates_presence_of :email, :email_confirmation,
:username, :password, :password_confirmation
validates_format_of :email,
:with => /^([^@\s]+)@((?:[-a-z0-9]+.)+[a-z]{2,})$/i
validates_uniqueness_of :username
validates_length_of :password, :within => 6…20
validates_confirmation_of :email, :password
def self.authenticate(username, password)
find_first([“username=? AND password=?”, username, password])
end
end
and this is my controller:
class Account::AuthController < ApplicationController
model :account
…
end
I guess the problem is that I’m using a module, my controller is
inside controllers/account/auth_controller.rb.
I’m not able to find the mistake, my model is clearly a class …
Ideas ?
TIA,
ngw
Nicholas W.
[email protected]
Yahoo! Mail: gratis 1GB per i messaggi e allegati da 10MB
http://mail.yahoo.it