Ruby on Rails Saturday, March 26, 2016

On 26 March 2016 at 09:30, Naveed Alam <lists@ruby-forum.com> wrote:
> Dear friends,
>
> I get the following error when I goto the privilege page.
>
> NoMethodError in Employee#edit_privilege
>
> Showing app/views/employee/edit_privilege.html.erb where line #82
> raised:
>
> You have a nil object when you didn't expect it!
> You might have expected an instance of ActiveRecord::Base.
> The error occurred while evaluating nil.[]
>
> app/models/privilege.rb:24:in `applicable?'

The error says you have called the method [] on an object that is nil.
You don't seem to have shown us line 24 of privilege.rb (and the
surrounding lines).

Colin

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAL%3D0gLtm50eZmD%2BuBkyDic8r9zXBZhtAFm1REW0f0mD5qqpi7g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment