Class: Trailblazer::Cell

Inherits:
Cell::ViewModel
  • Object
show all
Extended by:
ViewName::Path
Includes:
Layout::External
Defined in:
lib/trailblazer/cell.rb

Defined Under Namespace

Modules: ViewName

Class Method Summary collapse

Instance Method Summary collapse

Methods included from ViewName::Path

_view_name

Class Method Details

.class_from_cell_name(name) ⇒ Object



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

def class_from_cell_name(name)
  name.camelize.constantize
end

.controller_pathObject

Comment::Cell::Show #=> comment/view/



35
36
37
# File 'lib/trailblazer/cell.rb', line 35

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

.view_nameObject



43
44
45
# File 'lib/trailblazer/cell.rb', line 43

def view_name
  @view_name ||= _view_name
end

.views_dirObject



39
40
41
# File 'lib/trailblazer/cell.rb', line 39

def views_dir
  "view"
end

Instance Method Details

#state_for_implicit_render(options) ⇒ Object

Comment::Cell::Show #=> show



51
52
53
# File 'lib/trailblazer/cell.rb', line 51

def state_for_implicit_render(options)
  self.class.view_name
end