Class: Homeland::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/homeland/configuration.rb

Instance Attribute Summary collapse

Instance Attribute Details

#app_nameObject

set Homeland Application Title, default: ‘Homeland’



58
59
60
# File 'lib/homeland/configuration.rb', line 58

def app_name
  @app_name
end

#authenticate_user_methodObject

authenticate_user method in your Controller, default: ‘authenticate_user!’



55
56
57
# File 'lib/homeland/configuration.rb', line 55

def authenticate_user_method
  @authenticate_user_method
end

#current_user_methodObject

current_user method name in your Controller, default: ‘current_user’



52
53
54
# File 'lib/homeland/configuration.rb', line 52

def current_user_method
  @current_user_method
end

#markupObject

Content markup, allow: [:markdown, :html, :simple], default: :markdown



4
5
6
# File 'lib/homeland/configuration.rb', line 4

def markup
  @markup
end

#node_colorsObject

Returns the value of attribute node_colors.



66
67
68
# File 'lib/homeland/configuration.rb', line 66

def node_colors
  @node_colors
end

#per_pageObject

pagination size, default: 32



61
62
63
# File 'lib/homeland/configuration.rb', line 61

def per_page
  @per_page
end

#user_admin_methodObject

method in User model for check user do have permission manage Homeland. default: ‘admin?’

Example:

class User

def admin?
  Setting.forum_admins.include?(self.email)
end

end



37
38
39
# File 'lib/homeland/configuration.rb', line 37

def user_admin_method
  @user_admin_method
end

#user_avatar_url_methodObject

method of user avatar in User model, default: nil

We suggest you give Homeland image size more than 48x48 px.

Example:

class User

def homeland_avatar_url
  self.avatar.url('48x48')
end

end

config.user_avatar_url_method = :homeland_avatar_url



25
26
27
# File 'lib/homeland/configuration.rb', line 25

def user_avatar_url_method
  @user_avatar_url_method
end

#user_classObject

class name of you User model, default: ‘User’



6
7
8
# File 'lib/homeland/configuration.rb', line 6

def user_class
  @user_class
end

#user_name_methodObject

method of user name in User model, default: ‘name’



9
10
11
# File 'lib/homeland/configuration.rb', line 9

def user_name_method
  @user_name_method
end

#user_profile_url_methodObject

method name of user profile page path, in User model, default: ‘profile_url’ Example:

class User

def profile_url
  "http://www.host.com/u/#{self.username}"
end

end

config.user_profile_url_method = ‘profile_url’



49
50
51
# File 'lib/homeland/configuration.rb', line 49

def 
  @user_profile_url_method
end