Posts [ 5 ]

Topic: Javascript calling :actions

What's the best way to assign an onClick= to an element that uses the :controller =>, :action => syntax? Basically, I want to blend javascript with rails routing. I've done a lot of searching around, but can't seem to find a solution.

Re: Javascript calling :actions

This is specifically a <TR> with a bunch of <TD> elements. I wanted to add an onClick= to the <TR> so that you could click the row anywhere and call a :controller/:action. Using link_to to construct the complex <TR> seems like overkill. I was hoping to just attach some javascript to the <TR> like:<tr onClick="url => { :controller => 'foo', :action => 'bar'})">