Re: [Rails] Having trouble with named_scopes for my view

2016-03-11 Thread Walter Lee Davis
> On Mar 10, 2016, at 3:11 AM, Colin Law wrote: > > On 9 March 2016 at 22:25, David Williams wrote: >> Colin Law wrote in post #1182073: >>> On 9 March 2016 at 21:51, David Williams wrote: "articles"."category_id" = ? ORDER BY "articles"."created_at" DESC [["category_id", 1]]

Re: [Rails] Having trouble with named_scopes for my view

2016-03-09 Thread Colin Law
On 9 March 2016 at 21:51, David Williams wrote: > In my articles model, I created a scope that links categories to their > respective articles posts. When I use the rails console, the method > works perfectly when I query the db. > > article.rb > > scope :category_technology, -> {where(category_id

[Rails] Having trouble with named_scopes for my view

2016-03-09 Thread David Williams
In my articles model, I created a scope that links categories to their respective articles posts. When I use the rails console, the method works perfectly when I query the db. article.rb scope :category_technology, -> {where(category_id: 1)} @articles.category_technology Article Load (0.5ms) SE