Module: Odania
- Defined in:
- lib/odania/admin.rb,
lib/odania.rb,
lib/odania/filter.rb,
lib/odania/taggable.rb,
app/models/odania/site.rb,
lib/odania/text_helper.rb,
lib/odania/configuration.rb,
lib/odania/taggable/core.rb,
app/models/odania/language.rb,
app/models/odania/target_type.rb,
lib/odania/taggable/tag_count.rb,
lib/odania/controllers/helpers.rb,
lib/odania/taggable/tag_module.rb,
lib/odania/core_target_type_util.rb,
lib/odania/controllers/url_helpers.rb,
app/helpers/odania/application_helper.rb,
app/controllers/application_controller.rb
Overview
Thanks to github.com/mbleigh/acts-as-taggable-on
Defined Under Namespace
Modules: Admin, ApplicationHelper, Controllers, CoreTargetTypeUtil, Filter, Taggable, TargetType, TextHelper Classes: ApplicationController, Configuration, Content, ContentsController, DeliverController, Language, Menu, MenuController, MenuItem, Site, StatisticsController, Tag, TagXref, TagsController, User, UserRole
Constant Summary collapse
- @@helpers =
Set.new
- @@templates =
Hash.new
- @@components =
Set.new
- @@trackable_classes =
Set.new
Class Method Summary collapse
- .admin ⇒ Object
-
.config ⇒ Object
Retrieve configuration.
-
.include_helpers(scope) ⇒ Object
Include helpers in the given scope to AC and AV.
-
.setup {|Odania::Configuration| ... } ⇒ Object
Configure the Odania Portal, example for an initializer:.
- .table_name_prefix ⇒ Object
- .templates_for_select ⇒ Object
Class Method Details
.config ⇒ Object
Retrieve configuration
47 48 49 |
# File 'lib/odania.rb', line 47 def self.config Odania::Configuration end |
.include_helpers(scope) ⇒ Object
Include helpers in the given scope to AC and AV.
52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 |
# File 'lib/odania.rb', line 52 def self.include_helpers(scope) ActiveSupport.on_load(:action_controller) do include scope::Helpers if defined?(scope::Helpers) include scope::UrlHelpers layout :set_layout end ActiveSupport.on_load(:action_view) do include scope::UrlHelpers end ActiveSupport.on_load(:active_record) do extend Odania::Taggable end end |
.setup {|Odania::Configuration| ... } ⇒ Object
Configure the Odania Portal, example for an initializer:
Odania.configure do |config|
config.user_signed_in_function = 'signed_in?'
end
This examples shows only a part of the configuration possibilities
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/odania.rb', line 30 def self.setup yield Odania::Configuration @@helpers.each { |h| h.define_helpers(self.config) } # Enqueue for background processing if Odania.config.background_enqueue.blank? Rails.logger.error 'No background_enqueue defined!' Odania.config.background_enqueue = 'puts \'FallbackEnqueue\';puts' end module_eval <<-METHODS, __FILE__, __LINE__ + 1 def self.enqueue(background_type, opts) #{Odania.config.background_enqueue}(background_type, opts) end METHODS end |
.table_name_prefix ⇒ Object
2 3 4 |
# File 'lib/odania.rb', line 2 def self.table_name_prefix 'odania_' end |
.templates_for_select ⇒ Object
73 74 75 76 77 78 79 80 |
# File 'lib/odania.rb', line 73 def self.templates_for_select result = [] self.templates.each_value do |template| result << [template[:name], template[:template]] end result end |