Re: [Rails] Having trouble with boolean method

2016-02-08 Thread Walter Lee Davis
> On Feb 7, 2016, at 8:52 PM, David Williams wrote: > > I got it! had to set self.is_admin? Thanks for pointing me in the right > direction. I'm not sure this is doing what you think it is. If you have a boolean column on your model called is_admin, then Rails will define an is_admin? method

Re: [Rails] Having trouble with boolean method

2016-02-07 Thread Walter Lee Davis
> On Feb 7, 2016, at 7:20 PM, David Williams wrote: > > I'm checking if a user is an admin, and then I will show a delete button > if he is. For whatever reason, it's automatically setting the boolean to > true. It says is_admin: false in the console when I pull up the user's > record. > > > C

[Rails] Having trouble with boolean method

2016-02-07 Thread David Williams
I'm checking if a user is an admin, and then I will show a delete button if he is. For whatever reason, it's automatically setting the boolean to true. It says is_admin: false in the console when I pull up the user's record. Check status of user def is_admin? self.username end view method <%