Hi all, is there a Rails way to associate an onclick event to a HTML
element and invoke
a controller’s action?
I have a table, and I want to show some info when user click on a row.
Any better idea to achieve
this one?
Hi all, is there a Rails way to associate an onclick event to a HTML
element and invoke
a controller’s action?
I have a table, and I want to show some info when user click on a row.
Any better idea to achieve
this one?
Hi Eduardo,
Eduardo Yáñez Parareda wrote:
is there a Rails way to associate an onclick event to a HTML
element and invoke a controller’s action?I could be wrong and don’t have the time to verify this at the moment,
but I
believe that if you check the W3C spec you’ll find that events can only
be
assigned to controls. AFAIK, a table (nor its component elements) is
not a
control. I think you’ll need to use a link or button field as content
of
one of the table’s cells. For those, check the link_to and button_to
documentation at http://api.rubyonrails.orghth,
Bill
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.
Sponsor our Newsletter | Privacy Policy | Terms of Service | Remote Ruby Jobs