search for: news_categories

Displaying 2 results from an estimated 2 matches for "news_categories".

2006 Jul 03
0
Modelling Relationships as objects
DHH in Rails Confeerence pointed out that abstract relationships should be converted into concrete objects, CRUDying up relationships. An example would be class User < ActiveRecord::Base has_many :subscriptions has_many :news_categories, :through => :subscriptions end class NewsCategory < ActiveRecord::Base has_many :subscriptions has_many :users, :through => :subscriptions end class Subscription < ActiveRecord::Base belongs_to :user belongs_to :news_category end User and NewsCategory(2 tables in database)...
2007 Jul 19
7
NoMethodError in partial driving me mad
Hello, i simplified have a news model, a news category model and a news controller. my _news.rhtml partial renders a single news entry. in my controller there are the actions show and show_category. if the "show" action is called, a single news item is rendered through my partial with no errors. if the "show_category" action is called, i get a NoMethodError while displaying