Rendering a cell from a model?

31 views
Skip to first unread message

Mike Pence

unread,
Dec 21, 2012, 2:04:14 PM12/21/12
to cells-an...@googlegroups.com
Anyone know what is involved in having a model be able to render a cell, with url_helpers and all?

Nick Sutterer

unread,
Dec 23, 2012, 5:00:54 PM12/23/12
to cells-an...@googlegroups.com
Cell::Rails.render_cell_for(name, state, controller, *args) is your friend!

Ivgeni Slabkovski

unread,
Apr 29, 2013, 1:58:09 PM4/29/13
to cells-an...@googlegroups.com, mike....@gmail.com
Consider using a lightweight presenter for that. It behaves as a model in your view, but internally has access to the controller in this pattern.

Nick Sutterer

unread,
May 1, 2013, 7:37:34 PM5/1/13
to cells-an...@googlegroups.com
Example?


--
Sie haben diese Nachricht erhalten, weil Sie der Google Groups-Gruppe Cells and Apotomo beigetreten sind.
Um Ihr Abonnement für diese Gruppe zu beenden und keine E-Mails mehr von dieser Gruppe zu erhalten, senden Sie eine Email an cells-and-apot...@googlegroups.com.
Weitere Optionen: https://groups.google.com/groups/opt_out
 
 

Ivgeni Slabkovski

unread,
May 8, 2013, 9:17:20 AM5/8/13
to cells-an...@googlegroups.com
Well, any model like class would do, really. I would recommend deriving from active_attr's Base class, adding the logic for the model and controller and go from there. I do believe there are gems that already bind to the controller with a method_missing or other delegations.
Reply all
Reply to author
Forward
0 new messages