I did a simple migration...
----------------------------------------------
class AddAdminDesignationToUsers < ActiveRecord::Migration
def self.up
add_column :users, :is_admin, :boolean
end
def self.down
remove_column :users, :is_admin
end
end
----------------------------------------------
Now, if I go into the rails console, I can load a user from the DB and I
get correct results... u.is_admin? => false.
But if I put that in a view...
<% if user.is_admin? %>
blah
<% end %>
I get an error...
undefined method `is_admin?'' for #<User:0x47750ac>
Any ideas why? I''ve restarted the server, and everything else I could
think of.
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
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
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---