Module: DmCore::AccountHelper
- Included in:
- AvatarUploader, DmCore::Admin::AdminController, ApplicationController
- Defined in:
- app/helpers/dm_core/account_helper.rb
Instance Method Summary collapse
-
#account_prefix ⇒ Object
Get the account prefix that is used for locating items on the filesystem.
-
#account_protected_assets(leading_slash = true) ⇒ Object
Returns the path (from the root of the site) to the protected asset files Pass in false not to include leading slash ——————————————————————————.
-
#account_site_assets(leading_slash = true) ⇒ Object
Returns the path (from the root of the site) to the site general asset files Pass in false not to include leading slash ——————————————————————————.
-
#account_site_assets_media(leading_slash = true) ⇒ Object
Returns the path (from the root of the site) to the site’s uploadable asset folder, which is ‘media’ Pass in false not to include leading slash ——————————————————————————.
-
#account_site_assets_media_url ⇒ Object
Returns the url of the site’s media asset files Pass in false not to include leading slash ——————————————————————————.
-
#account_site_assets_url ⇒ Object
Returns the url of the site’s general asset files Pass in false not to include leading slash ——————————————————————————.
-
#current_account ⇒ Object
——————————————————————————.
Instance Method Details
#account_prefix ⇒ Object
Get the account prefix that is used for locating items on the filesystem.
11 12 13 |
# File 'app/helpers/dm_core/account_helper.rb', line 11 def account_prefix current_account.account_prefix end |
#account_protected_assets(leading_slash = true) ⇒ Object
Returns the path (from the root of the site) to the protected asset files
Pass in false not to include leading slash
25 26 27 |
# File 'app/helpers/dm_core/account_helper.rb', line 25 def account_protected_assets(leading_slash = true) leading_slash ? "/protected_assets/#{account_prefix}" : "protected_assets/#{account_prefix}" end |
#account_site_assets(leading_slash = true) ⇒ Object
Returns the path (from the root of the site) to the site general asset files
Pass in false not to include leading slash
18 19 20 |
# File 'app/helpers/dm_core/account_helper.rb', line 18 def account_site_assets(leading_slash = true) leading_slash ? "/site_assets/#{account_prefix}/site" : "site_assets/#{account_prefix}/site" end |
#account_site_assets_media(leading_slash = true) ⇒ Object
Returns the path (from the root of the site) to the site’s uploadable asset folder, which is ‘media’
Pass in false not to include leading slash
33 34 35 |
# File 'app/helpers/dm_core/account_helper.rb', line 33 def account_site_assets_media(leading_slash = true) account_site_assets(leading_slash) + '/media' end |
#account_site_assets_media_url ⇒ Object
Returns the url of the site’s media asset files
Pass in false not to include leading slash
47 48 49 |
# File 'app/helpers/dm_core/account_helper.rb', line 47 def account_site_assets_media_url Account.current.url_base + account_site_assets_media(true) end |