Class: Homeland::Configuration
- Inherits:
-
Object
- Object
- Homeland::Configuration
- Defined in:
- lib/homeland/configuration.rb
Instance Attribute Summary collapse
-
#app_name ⇒ Object
set Homeland Application Title, default: ‘Homeland’.
-
#authenticate_user_method ⇒ Object
authenticate_user method in your Controller, default: ‘authenticate_user!’.
-
#current_user_method ⇒ Object
current_user method name in your Controller, default: ‘current_user’.
-
#markup ⇒ Object
Content markup, allow: [:markdown, :html, :simple], default: :markdown.
-
#node_colors ⇒ Object
Returns the value of attribute node_colors.
-
#per_page ⇒ Object
pagination size, default: 32.
-
#user_admin_method ⇒ Object
method in User model for check user do have permission manage Homeland.
-
#user_avatar_url_method ⇒ Object
method of user avatar in User model, default: nil.
-
#user_class ⇒ Object
class name of you User model, default: ‘User’.
-
#user_name_method ⇒ Object
method of user name in User model, default: ‘name’.
-
#user_profile_url_method ⇒ Object
method name of user profile page path, in User model, default: ‘profile_url’ Example:.
Instance Attribute Details
#app_name ⇒ Object
set Homeland Application Title, default: ‘Homeland’
58 59 60 |
# File 'lib/homeland/configuration.rb', line 58 def app_name @app_name end |
#authenticate_user_method ⇒ Object
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_method ⇒ Object
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 |
#markup ⇒ Object
Content markup, allow: [:markdown, :html, :simple], default: :markdown
4 5 6 |
# File 'lib/homeland/configuration.rb', line 4 def markup @markup end |
#node_colors ⇒ Object
Returns the value of attribute node_colors.
66 67 68 |
# File 'lib/homeland/configuration.rb', line 66 def node_colors @node_colors end |
#per_page ⇒ Object
pagination size, default: 32
61 62 63 |
# File 'lib/homeland/configuration.rb', line 61 def per_page @per_page end |
#user_admin_method ⇒ Object
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_method ⇒ Object
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_class ⇒ Object
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_method ⇒ Object
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_method ⇒ Object
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 @user_profile_url_method end |