Pregunta

I am using Apotomo with Rails and 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.

¿Fue útil?

Solución

You need to use render_state that comes from Cells, upon which Apotomo is built. It can be used with arguments like this:

root.find_widget(:messages).render_state(:display, my_variable: its_value)
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top