For some reason the Squirrel plugin is producing two different results
between Mongrel and Passenger.
Mongrel serves up the page with no problems and no errors in the
development log.
Passenger gives the following error:
NoMethodError in ContractsController#index
undefined method `username' for nil:NilClass
Below is my setup in relevant part.
contracts_controller.rb:
...
def index
if admin?
@contracts = Contract.find(:all)
else
@contracts = Contract.find(:all) do
user.username == current_user.username
end
end
end
...
end
I have also tried 'self.user.username == current_user.username'
without success.
contract.rb:
class Contract < ActiveRecord::Base
...
belongs_to :user
...
end
user.rb:
class User < ActiveRecord::Base
acts_as_authentic
...
has_many :contracts
...
end
Not sure what the problem is. Would appreciate some help.
-Alexis
--
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.