trailblazer / cells

View components for Ruby and Rails.
https://trailblazer.to/2.1/docs/cells.html
3.07k stars 236 forks source link

self_contained and view helper "cell" not working together #271

Closed byu closed 9 years ago

byu commented 9 years ago

4.0.0.beta2:

if I make a app/cells/comment/cell.rb self_contained cell, I can render just fine by doing Comment::Cell.new(controller, @comment).show.

But in some other controller's view, I try using: <%= cell(:comment, @comment) %>

the http request errors out with uninitialized constant CommentCell.

It looks like class_from_cell_name in view_model.rb has the line:

"#{name}_cell".classify.constantize

apotonick commented 9 years ago

You need to use the #concept helper instead of #cell. This is because you use the new, cooler, better, beautifuler and sexier concept (Trailblazer) naming style Comment::Cell.