Class: ComfortableMexicanSofa::Configuration
- Inherits:
-
Object
- Object
- ComfortableMexicanSofa::Configuration
- Defined in:
- lib/comfortable_mexican_sofa/configuration.rb
Instance Attribute Summary collapse
-
#admin_auth ⇒ Object
Module that will handle authentication to access cms-admin area.
-
#admin_cache_sweeper ⇒ Object
A class that is included as a sweeper to admin base controller if it’s set.
-
#admin_locale ⇒ Object
Admin interface will respect the locale of the site being managed.
-
#admin_route_prefix ⇒ Object
Default url to access admin area is yourhost/cms-admin/ You can change ‘cms-admin’ to ‘admin’, for example.
-
#admin_route_redirect ⇒ Object
When arriving at /cms-admin you may chose to redirect to arbirtary path, for example ‘/cms-admin/users’.
-
#allow_irb ⇒ Object
Not allowing irb code to be run inside page content.
-
#allowed_helpers ⇒ Object
Whitelist of all helper methods that can be used via {cms:helper} tag.
-
#allowed_partials ⇒ Object
Whitelist of partials paths that can be used via {cms:partial} tag.
-
#cms_title ⇒ Object
Don’t like ComfortableMexicanSofa? Set it to whatever you like.
-
#database_config ⇒ Object
Database prefix.
-
#enable_fixtures ⇒ Object
With each page load, files will be synched with the database.
-
#fixtures_path ⇒ Object
Path where fixtures can be located.
-
#locales ⇒ Object
Locale definitions.
-
#public_auth ⇒ Object
Module that will handle authentication for public pages.
-
#revisions_limit ⇒ Object
Number of revisions kept.
-
#upload_file_options ⇒ Object
Upload settings.
-
#use_default_routes ⇒ Object
Normally we include default routes from github.com/comfy/comfortable-mexican-sofa/blob/master/config/routes.rb If you want to include the routes manually set this to false.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
Configuration defaults.
Constructor Details
#initialize ⇒ Configuration
Configuration defaults
69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 |
# File 'lib/comfortable_mexican_sofa/configuration.rb', line 69 def initialize @cms_title = 'ComfortableMexicanSofa CMS Engine' @admin_auth = 'ComfortableMexicanSofa::HttpAuth' @public_auth = 'ComfortableMexicanSofa::DummyAuth' @seed_data_path = nil @admin_route_prefix = 'cms-admin' @admin_route_redirect = '' @use_default_routes = true @upload_file_options = { :url => '/system/:class/:id/:attachment/:style/:filename' } @enable_fixtures = false @fixtures_path = File.('db/cms_fixtures', Rails.root) @revisions_limit = 25 @locales = { 'en' => 'English', 'es' => 'Español', 'pt-BR' => 'Português Brasileiro', 'zh-CN' => '简体中文' } @admin_locale = nil @database_config = nil @admin_cache_sweeper = nil @allow_irb = false @allowed_helpers = nil @allowed_partials = nil end |
Instance Attribute Details
#admin_auth ⇒ Object
Module that will handle authentication to access cms-admin area
9 10 11 |
# File 'lib/comfortable_mexican_sofa/configuration.rb', line 9 def admin_auth @admin_auth end |
#admin_cache_sweeper ⇒ Object
A class that is included as a sweeper to admin base controller if it’s set
54 55 56 |
# File 'lib/comfortable_mexican_sofa/configuration.rb', line 54 def admin_cache_sweeper @admin_cache_sweeper end |
#admin_locale ⇒ Object
Admin interface will respect the locale of the site being managed. However you can force it to English by setting this to ‘:en`
45 46 47 |
# File 'lib/comfortable_mexican_sofa/configuration.rb', line 45 def admin_locale @admin_locale end |
#admin_route_prefix ⇒ Object
Default url to access admin area is yourhost/cms-admin/ You can change ‘cms-admin’ to ‘admin’, for example.
16 17 18 |
# File 'lib/comfortable_mexican_sofa/configuration.rb', line 16 def admin_route_prefix @admin_route_prefix end |
#admin_route_redirect ⇒ Object
When arriving at /cms-admin you may chose to redirect to arbirtary path, for example ‘/cms-admin/users’
20 21 22 |
# File 'lib/comfortable_mexican_sofa/configuration.rb', line 20 def admin_route_redirect @admin_route_redirect end |
#allow_irb ⇒ Object
Not allowing irb code to be run inside page content. False by default.
57 58 59 |
# File 'lib/comfortable_mexican_sofa/configuration.rb', line 57 def allow_irb @allow_irb end |
#allowed_helpers ⇒ Object
Whitelist of all helper methods that can be used via {cms:helper} tag. By default all helpers are allowed except ‘eval`, `send`, `call` and few others. Empty array will prevent rendering of all helpers.
62 63 64 |
# File 'lib/comfortable_mexican_sofa/configuration.rb', line 62 def allowed_helpers @allowed_helpers end |
#allowed_partials ⇒ Object
Whitelist of partials paths that can be used via {cms:partial} tag. All partials are accessible by default. Empty array will prevent rendering of all partials.
66 67 68 |
# File 'lib/comfortable_mexican_sofa/configuration.rb', line 66 def allowed_partials @allowed_partials end |
#cms_title ⇒ Object
Don’t like ComfortableMexicanSofa? Set it to whatever you like. :(
6 7 8 |
# File 'lib/comfortable_mexican_sofa/configuration.rb', line 6 def cms_title @cms_title end |
#database_config ⇒ Object
Database prefix. If you want to keep your comfortable mexican sofa tables in a location other than the default databases add a database_config. Setting this to ‘cms` will look for a cms_#Rails.env database definition in your database.yml file
51 52 53 |
# File 'lib/comfortable_mexican_sofa/configuration.rb', line 51 def database_config @database_config end |
#enable_fixtures ⇒ Object
With each page load, files will be synched with the database. Database entries are destroyed if there’s no corresponding file. Fixtures are disabled by default.
31 32 33 |
# File 'lib/comfortable_mexican_sofa/configuration.rb', line 31 def enable_fixtures @enable_fixtures end |
#fixtures_path ⇒ Object
Path where fixtures can be located.
34 35 36 |
# File 'lib/comfortable_mexican_sofa/configuration.rb', line 34 def fixtures_path @fixtures_path end |
#locales ⇒ Object
Locale definitions. If you want to define your own locale merge => ‘Locale Title’ with this.
41 42 43 |
# File 'lib/comfortable_mexican_sofa/configuration.rb', line 41 def locales @locales end |
#public_auth ⇒ Object
Module that will handle authentication for public pages
12 13 14 |
# File 'lib/comfortable_mexican_sofa/configuration.rb', line 12 def public_auth @public_auth end |
#revisions_limit ⇒ Object
Number of revisions kept. Default is 25. If you wish to disable: set this to 0.
37 38 39 |
# File 'lib/comfortable_mexican_sofa/configuration.rb', line 37 def revisions_limit @revisions_limit end |
#upload_file_options ⇒ Object
Upload settings
27 28 29 |
# File 'lib/comfortable_mexican_sofa/configuration.rb', line 27 def @upload_file_options end |
#use_default_routes ⇒ Object
Normally we include default routes from github.com/comfy/comfortable-mexican-sofa/blob/master/config/routes.rb If you want to include the routes manually set this to false
24 25 26 |
# File 'lib/comfortable_mexican_sofa/configuration.rb', line 24 def use_default_routes @use_default_routes end |