trailblazer / cells

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

Concepts (and probably Cells) should be able to use the `concept` helper #387

Closed pnomolos closed 8 years ago

pnomolos commented 8 years ago

Right now I've added

module Cell
  class ViewModel
    def concept(name, model=nil, options={}, &block)
      ::Cell::Concept.cell(name, model, options.merge(controller: parent_controller), &block)
    end
  end
end

to a rails initializer so that I can use concept inside a concept that's being rendered.

apotonick commented 8 years ago

I've changed that in Cells 4.1 (and upcoming 5.0). The main point is you shouldn't mix naming styles, and in that sense, Concept::cell will alias to concept which will now resolve a concept cell, and not an old-style cell anymore.

Thanks for reporting!

pnomolos commented 8 years ago

@apotonick Cool, thanks!