Module: Sunrise

Defined in:
lib/sunrise/core.rb,
lib/sunrise/utils.rb,
lib/sunrise/engine.rb,
lib/sunrise/plugin.rb,
lib/sunrise/plugins.rb,
lib/sunrise/version.rb,
lib/sunrise/models/page.rb,
lib/sunrise/models/role.rb,
lib/sunrise/models/user.rb,
lib/sunrise/utils/mysql.rb,
lib/sunrise/models/asset.rb,
lib/sunrise/utils/header.rb,
lib/sunrise/models/header.rb,
lib/sunrise/views/helpers.rb,
lib/sunrise/system_settings.rb,
lib/sunrise/models/role_type.rb,
lib/sunrise/models/structure.rb,
lib/sunrise/nested_set/depth.rb,
lib/sunrise/carrier_wave/glue.rb,
lib/sunrise/controllers/manage.rb,
lib/sunrise/utils/i18n_backend.rb,
lib/sunrise/views/form_builder.rb,
lib/sunrise/utils/settingslogic.rb,
lib/sunrise/models/position_type.rb,
lib/sunrise/models/structure_type.rb,
lib/sunrise/utils/transliteration.rb,
lib/sunrise/nested_set/descendants.rb,
lib/sunrise/controllers/head_options.rb,
lib/sunrise/controllers/model_filter.rb,
lib/sunrise/carrier_wave/base_uploader.rb,
lib/sunrise/utils/accessible_attributes.rb,
lib/generators/sunrise/install_generator.rb,
lib/sunrise/carrier_wave/file_size_validator.rb

Defined Under Namespace

Modules: CarrierWave, Controllers, Generators, Models, NestedSet, Utils, Views Classes: Engine, Plugin, Plugins, SystemSettings

Constant Summary collapse

VERSION =
"0.2.2".freeze
@@flash_keys =
[ :success, :failure ]
@@available_locales =
[]
@@title_spliter =
''
@@field_error_proc =
Proc.new do |html_tag, instance| 
  if html_tag =~ /<(input|textarea|select)/
    errors = instance.error_message.kind_of?(Array) ? instance.error_message : [instance.error_message]
    errors.collect! { |error| "<li>#{error}</li>" } 
    message = "<ul class='error_box error_box_narrow'>#{errors.join}</ul>".html_safe
    html_tag += message
  end
  
  if html_tag =~ /<label/
    html_tag
  else
    "<div class=\"field_with_errors\">#{html_tag}</div>".html_safe
  end
end

Class Method Summary collapse

Class Method Details

.setup {|_self| ... } ⇒ Object

Default way to setup Devise. Run rails generate devise_install to create a fresh initializer with all configuration values.

Yields:

  • (_self)

Yield Parameters:

  • _self (Sunrise)

    the object that the method was called on



68
69
70
# File 'lib/sunrise/core.rb', line 68

def self.setup
  yield self
end