Module: AppyantraAdmin

Defined in:
lib/appyantra_admin.rb,
lib/appyantra_admin/utils.rb,
lib/appyantra_admin/crypto.rb,
lib/appyantra_admin/engine.rb,
lib/appyantra_admin/version.rb,
app/sweepers/appyantra_admin/pages_sweeper.rb,
app/controllers/appyantra_admin/home_controller.rb,
app/controllers/appyantra_admin/pages_controller.rb,
app/controllers/appyantra_admin/users/user_paths.rb,
app/controllers/appyantra_admin/users_controller.rb,
app/controllers/appyantra_admin/assets_controller.rb,
app/controllers/appyantra_admin/profiles_controller.rb,
app/controllers/appyantra_admin/sessions_controller.rb,
app/controllers/appyantra_admin/passwords_controller.rb,
app/controllers/appyantra_admin/application_controller.rb,
app/controllers/appyantra_admin/admin_settings_controller.rb,
app/controllers/appyantra_admin/users/sessions_controller.rb,
app/controllers/appyantra_admin/users/passwords_controller.rb,
app/controllers/appyantra_admin/users/confirmations_controller.rb,
app/controllers/appyantra_admin/users/registrations_controller.rb

Defined Under Namespace

Modules: AdminSettingsHelper, ApplicationHelper, Crypto, PagesHelper, Utils Classes: AdminSettingsController, ApplicationController, AssetsController, Engine, HomeController, InstallGenerator, PagesController, PagesSweeper, PasswordsController, ProfilesController, SessionsController, UsersController

Constant Summary collapse

VERSION =
"0.0.1"
@@assets =
[]
@@mail_settings_fields =
{}
@@rake_running =
false
@@page_layouts =
nil

Class Method Summary collapse

Class Method Details

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

setup for AppYantra Admin to be used in the initializer

Yields:

  • (_self)

Yield Parameters:



26
27
28
# File 'lib/appyantra_admin.rb', line 26

def self.setup
  yield self
end

.setup_mailerObject



30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# File 'lib/appyantra_admin.rb', line 30

def self.setup_mailer
  return unless ActiveRecord::Base.connection.table_exists? 'admin_settings'
  # get the mailer settings from the DB and set them in ActionMailer
  mailer_settings = AdminSetting.group_settings 'Mail'
  ActionMailer::Base.default_url_options = { :host => 'localhost:3000' }
  unless mailer_settings.empty?
    ActionMailer::Base.default_url_options = { :host => mailer_settings[:default_url_host] }
    ActionMailer::Base.delivery_method = mailer_settings[:delivery_method].to_sym if mailer_settings[:delivery_method]
    ActionMailer::Base.smtp_settings = {
        :address => mailer_settings[:address],
        :port => (mailer_settings[:port] || "587").to_i,
        :domain => mailer_settings[:domain],
        :user_name => mailer_settings[:user_name],
        :password => mailer_settings[:password],
        :authentication => mailer_settings[:authentication],
        :enable_starttls_auto => (mailer_settings[:enable_starttls_auto] == "true")
    }
  end
end