Class: Trailblazer::Generator::Cell

Inherits:
Cell::ViewModel
  • Object
show all
Extended by:
ClassMethods
Includes:
Cell::Erb
Defined in:
lib/trailblazer/generator/cell.rb

Defined Under Namespace

Modules: ClassMethods

Class Method Summary collapse

Instance Method Summary collapse

Methods included from ClassMethods

build_model

Class Method Details

.controller_pathObject



16
17
18
# File 'lib/trailblazer/generator/cell.rb', line 16

def self.controller_path
  util.underscore(name.sub(/Cell$/, '')).split("/")[-1]
end

Instance Method Details

#action_classObject



29
30
31
# File 'lib/trailblazer/generator/cell.rb', line 29

def action_class
  Trailblazer::Generator::Inflector.camelize(action)
end

#showObject



23
24
25
26
27
# File 'lib/trailblazer/generator/cell.rb', line 23

def show
  render action
rescue ::Cell::TemplateMissingError
  render :generic
end

#underscore_nameObject



33
34
35
# File 'lib/trailblazer/generator/cell.rb', line 33

def underscore_name
  Trailblazer::Generator::Inflector.underscore(name)
end