Class: ProfileFieldTypes::Homepage
- Inherits:
-
ProfileField
- Object
- ActiveRecord::Base
- ProfileField
- ProfileFieldTypes::Homepage
- Defined in:
- app/models/profile_field_types/homepage.rb
Overview
Homepage Field
Class Method Summary collapse
Instance Method Summary collapse
Methods inherited from ProfileField
#children_count, #delete_cache, #key, #label, #orig_profileable, possible_types, #profileable, #save, #underscored_type, #value
Methods inherited from ActiveRecord::Base
Class Method Details
.model_name ⇒ Object
6 |
# File 'app/models/profile_field_types/homepage.rb', line 6 def self.model_name; ProfileField.model_name; end |
Instance Method Details
#display_html ⇒ Object
8 9 10 11 12 13 14 15 16 |
# File 'app/models/profile_field_types/homepage.rb', line 8 def display_html url = self.value || '' url = "http://#{url}" unless url.starts_with? 'http://' or url == "—" if url.starts_with?( "http://" ) ActionController::Base.helpers.link_to url, url else url end end |