rendering with parameters

16 views
Skip to first unread message

John Lane

unread,
Dec 13, 2013, 10:29:08 AM12/13/13
to cells-an...@googlegroups.com
Hello,

I have some code that looks like this:

root.find_widget(:messages).render :state => :display

which works fine.

I would like to pass some data along with that call. How do I do that?

I imagine something like this:

root.find_widget(:messages).render :state => :display, :my_variable => its_value

and then to be able to access my_variable in the widget's display method.

Please is there a way to do this?

Thanks.


Nick Sutterer

unread,
Dec 14, 2013, 8:32:25 PM12/14/13
to cells-an...@googlegroups.com
Hey John,

use widget.render_state(:display, *args) isn't that documented? Maybe I should update the README a bit.


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

John (Google)

unread,
Dec 17, 2013, 3:31:51 PM12/17/13
to cells-an...@googlegroups.com
Ah, thanks Nick. Yes that works. I couldn't find render_state in the API documentation. I did look.

I now have

root.find_widget(:messages).render_state(:display, my_variable: its_value)

Cheers,
John

Nick Sutterer

unread,
Dec 17, 2013, 5:55:32 PM12/17/13
to cells-an...@googlegroups.com
Hi John- render_state sits in cells, the underlying view component gem. I should update the Apotomo README just as I did it with Roar and representable last week :/
Reply all
Reply to author
Forward
0 new messages