Class: Trailblazer::Cell
- Inherits:
-
Cell::ViewModel
- Object
- Cell::ViewModel
- Trailblazer::Cell
- Defined in:
- lib/trailblazer/cell.rb
Defined Under Namespace
Class Method Summary collapse
- ._view_name ⇒ Object
- .class_from_cell_name(name) ⇒ Object
- .controller_path ⇒ Object
- .view_name ⇒ Object
- .views_dir ⇒ Object
Instance Method Summary collapse
Methods included from Layout
Methods included from Show
Class Method Details
._view_name ⇒ Object
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_path ⇒ Object
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_name ⇒ Object
22 23 24 |
# File 'lib/trailblazer/cell.rb', line 22 def view_name @view_name ||= _view_name end |
.views_dir ⇒ Object
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() self.class.view_name end |