Module: Crud

Defined in:
app/models/crud/klass_info.rb,
lib/crud.rb,
lib/crud/engine.rb,
lib/crud/version.rb,
app/models/crud/klass_list.rb,
app/helpers/crud/crud_helper.rb,
app/jobs/crud/application_job.rb,
app/helpers/crud/dashboard_helper.rb,
app/models/crud/application_record.rb,
app/helpers/crud/application_helper.rb,
app/mailers/crud/application_mailer.rb,
app/controllers/crud/crud_controller.rb,
app/models/crud/menus/development_menu.rb,
app/controllers/crud/crud_base_controller.rb,
app/controllers/crud/dashboard_controller.rb,
app/controllers/crud/application_controller.rb

Overview

Development Menu

Defined Under Namespace

Modules: ApplicationHelper, CrudHelper, DashboardHelper, VERSION Classes: ApplicationController, ApplicationJob, ApplicationMailer, ApplicationRecord, CrudBaseController, CrudController, DashboardController, Engine, KlassInfo, KlassList

Class Method Summary collapse

Class Method Details

.gem_versionObject

Returns the version of the currently loaded gem as a Gem::Version



3
4
5
# File 'lib/crud/version.rb', line 3

def self.gem_version
  Gem::Version.new VERSION::STRING
end

.is_allowed_to_updateObject

self.is_allowed_to_update = false



43
44
45
46
47
48
# File 'lib/crud.rb', line 43

def self.is_allowed_to_update
  is_allowed = @@is_allowed_to_update.nil? ? lambda { |controller| return true } :
    lambda {|controller| return ((@@is_allowed_to_update.class == Proc) ? @@is_allowed_to_update.call(controller) : @@is_allowed_to_update)}

  is_allowed
end

.is_allowed_to_viewObject

self.is_allowed_to_view = true



32
33
34
35
36
37
# File 'lib/crud.rb', line 32

def self.is_allowed_to_view
  is_allowed = @@is_allowed_to_view.nil? ? lambda { return true } :
    lambda {|controller| return ((@@is_allowed_to_view.class == Proc) ? @@is_allowed_to_view.call(controller) : @@is_allowed_to_view)}

  is_allowed
end

.mounted_pathObject



132
133
134
# File 'lib/crud.rb', line 132

def self.mounted_path
  ::Crud::Engine.mounted_path
end

.railtie_nameObject



128
129
130
# File 'lib/crud.rb', line 128

def self.railtie_name
  ::Crud::Engine.railtie_name
end

.root_pathObject



136
137
138
# File 'lib/crud.rb', line 136

def self.root_path
  ::Crud::Engine.root
end

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

Default way to setup the engine.

Run ‘rails generate crud_install’ to create a fresh initializer with all configuration values.

Yields:

  • (_self)

Yield Parameters:

  • _self (Crud)

    the object that the method was called on



124
125
126
# File 'lib/crud.rb', line 124

def self.setup
  yield self
end

.versionObject



7
8
9
# File 'lib/crud/version.rb', line 7

def self.version
  VERSION::STRING.to_f
end