Skip to main content

A simple RoR example

2 replies [Last post]
Joined: 2007-10-07

Hi All,
I am looking for a simple RoR example with jMaki. Something like a button and text field that shows how to wire the button onclick action to a controller\view that shows the text entered. I am having difficultly in understanding how to setup the publish and subscribe infrastructure between a jMaki widget and a controller\view on the backend. I think this type of example would also benefit others who are exploring jMaki with RoR. Thanks for all assistance provided.
- Terry

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Joined: 2007-10-07

Thanks for the sample Arun. I understand how to create a topic for the Yahoo button, but how do I invoke a action in a controller. Using standard RR, I would have the following:

<%= button_to "Checkout", :action => :checkout %>

How would I do the same with a Yahoo button with jmaki?
I understand that from the rmtl the button code fragment would look like the following:

<%= jmaki_widget 'yahoo.button',
:value => { :label => 'Select 1',
:action => { :topic => '/jmaki/store/checkout',
:message => { :targetId => '1' }

How do I configure jmaki so that when the user clicks on the button, it will invoke the checkout action in the store controller?

Do I need to setup a listener in glue.js?

Thanks for all assistance provided.

Joined: 2003-06-13

Hi Terry, should give you what you need. There are text instructions in the Comments of the blog.