forked from bofh/fetsite
AutoCommit Fre Aug 7 00:03:02 CEST 2015
This commit is contained in:
@@ -5,9 +5,16 @@ class Survey::Choice < ActiveRecord::Base
|
||||
include ActionView::Helpers::TagHelper
|
||||
mount_uploader :picture, PictureUploader
|
||||
def to_s
|
||||
self.text
|
||||
self.text
|
||||
end
|
||||
def html
|
||||
content_tag("i","", class: self.icon ) + self.text
|
||||
content_tag("i","", class: self.icon ) + self.text
|
||||
end
|
||||
def attributes_for_copy
|
||||
self.attributes.select{|k,v| ["text","sort", "picture", "icon"].include?(k)}
|
||||
end
|
||||
def copy_from_template
|
||||
cpy = Survey::Choice.new(self.attributes_for_copy)
|
||||
cpy.save
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user