Class: Address
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Address
- Defined in:
- app/models/address.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
Returns the value of attribute name.
Instance Method Summary collapse
-
#to_html(name_to_use = '') ⇒ Object
——————————————————————————.
-
#to_s(name_to_use = '') ⇒ Object
——————————————————————————.
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name.
6 7 8 |
# File 'app/models/address.rb', line 6 def name @name end |
Instance Method Details
#to_html(name_to_use = '') ⇒ Object
20 21 22 23 |
# File 'app/models/address.rb', line 20 def to_html(name_to_use = '') # self.to_s(name_to_use).gsub("\n", "<br/>".html_safe) self.to_s(name_to_use).split(/\n/).xss_aware_join('<br>'.html_safe) end |
#to_s(name_to_use = '') ⇒ Object
14 15 16 17 |
# File 'app/models/address.rb', line 14 def to_s(name_to_use = '') self.name = name_to_use postal_address.strip end |