Class: Trailblazer::Cell

Inherits:
Cell::ViewModel
  • Object
show all
Includes:
Layout, Show
Defined in:
lib/trailblazer/cell.rb

Defined Under Namespace

Modules: Layout, Show

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Layout

#render, #with_layout

Methods included from Show

#show

Class Method Details

._view_nameObject



26
27
28
29
# File 'lib/trailblazer/cell.rb', line 26

def _view_name
  class_name = to_s.split("::").last
  util.underscore(class_name).downcase
end

.class_from_cell_name(name) ⇒ Object



10
11
12
# File 'lib/trailblazer/cell.rb', line 10

def class_from_cell_name(name)
  name.camelize.constantize
end

.controller_pathObject



14
15
16
# File 'lib/trailblazer/cell.rb', line 14

def controller_path
  @controller_path ||= File.join(util.underscore(name.sub(/(::Cell.+)/, '')), views_dir)
end

.view_nameObject



22
23
24
# File 'lib/trailblazer/cell.rb', line 22

def view_name
  @view_name ||= _view_name
end

.views_dirObject



18
19
20
# File 'lib/trailblazer/cell.rb', line 18

def views_dir
  "view"
end

Instance Method Details

#state_for_implicit_render(options) ⇒ Object



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

def state_for_implicit_render(options)
  self.class.view_name
end