search for: badcomment

Displaying 1 result from an estimated 1 matches for "badcomment".

Did you mean: addcomment
2006 Mar 07
1
Access flash from a model class?
I have a method that returns either a comment stored in the flash (if it exists) or a new comment. It works when I put it in my application controller: def preform_comment if flash[:badcomment].nil? comment = Comment.new return comment else return flash[:badcomment] end end However it would be cleaner to put this in the Comment model, so I tried: def self.preform if flash[:badcomment].nil? comment = Comment.new return comment else...