ExCell v0.0.14 ExCell.View View Source
Cell helpers used to render the cells in both Views and Cells
Link to this section Summary
Functions
Renders a cell in the view
Renders a cell in the view with children without a block
Renders the cell directly as a string, used for testing purposes
Returns the relative path of a module to the namespace. This method is used to determine the template path of the cell
Link to this section Functions
Link to this function
cell(cell) View Source
Renders a cell in the view.
### Examples
iex(0)> safe_to_string(AppWeb.AvatarView.cell(AvatarCell))
"<div class="AvatarCell" ...>"
Link to this function
cell(cell, assigns) View Source
Renders a cell in the view with children without a block.
Examples
iex(0)> safe_to_string(AppWeb.AvatarView.cell(AvatarCell, "Hello"))
"<div class="AvatarCell" ...>Hello</div>"
Link to this function
cell(cell, assigns, assigns) View Source
Link to this function
cell_to_string(cell) View Source
Renders the cell directly as a string, used for testing purposes.
Examples
iex(0)> AppWeb.AvatarView.cell_to_string(AvatarCell)
"<div class="AvatarCell" ...>"
Link to this function
cell_to_string(cell, assigns) View Source
Link to this function
cell_to_string(cell, assigns, list) View Source
Link to this function
relative_path(module, namespace) View Source
Returns the relative path of a module to the namespace. This method is used to determine the template path of the cell.
Examples
iex(0)> ExCell.View.relative_path(AppWeb.AvatarCell, AppWeb)
"avatar"
iex(1)> ExCell.View.relative_path(AppWeb.Namespace.AvatarCell, AppWeb)
"namespace/avatar"