Class: ProfileFieldTypes::Homepage

Inherits:
ProfileField show all
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, #underscored_type, #value

Methods inherited from ActiveRecord::Base

#readonly?

Class Method Details

.model_nameObject



6
# File 'app/models/profile_field_types/homepage.rb', line 6

def self.model_name; ProfileField.model_name; end

Instance Method Details

#display_htmlObject



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