Closed firedev closed 9 years ago
I still don't understand how
def to_s
call.html_safe
end
will save you from having to define a #show
method, because to_s
will call call
which will call show
, so your actual problem is the "missing" show
method.
As discussed, this is a design decision I made to avoid confusion for new users who will have trouble understanding that they
render :another_template
)#show
(def show; @bla = Whatever.(); end
)render(:item) + render + "hello"
).You can easily add a show
method to your "base class".
Cell::Concept.class_eval do
def show; render; end
end
Also, the to_s
method is already aliased to call
, which, in Rails, will call show.html_safe
.
Instead of having...
...in each cell I suggest to have...
... in the super class.
Profits?
= cell
,=cell.call
and=cell.(collection: ...)
that is mentioned in https://github.com/apotonick/cells/issues/305#issuecomment-144010183