Search code examples
ruby-on-railsapotomo

Can Apotomo render pass parameters?


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.


Solution

  • 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)