Displaying 1 result from an estimated 1 matches for "preform_com".
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...