Hello,
I would like to update a partial on the screen, by hovering over a
‘
’ element, between the
's there are several statements both
in HTML as in Rails…
In Rails 2, one could write :
<a href="#" onmouseover=“new Ajax.Updater(‘comment’,/view/comment/’+<%=
projectstep.id.to_s+”" %>), {asynchronous:true, evalScript:true});
return false;">
Here plenty of statements including <% if condition %> etc…
In Rails 3, I could only find :
link_to(body, url, html_options = {})
or
<%= link_to image_tag(“delete.png”), { :controller => ‘products’,
:action => ‘destroy’, :id => product }, :method => :delete, :confirm =>
“Are you sure?”, :remote => true %>
Is there a way to have the same option as in Rails 2 ??
On Tue, May 24, 2011 at 3:26 PM, Branko Wi [email protected] wrote:
return false;">
Here plenty of statements including <% if condition %> etc…
In Rails 3, I could only find :
link_to(body, url, html_options = {})
you can still pass
onmouseover=“new
Ajax.Updater(‘comment’,/view/comment/'+<%=projectstep.id.to_s+”" %>),
{asynchronous:true, evalScript:true});return false;"
to the html_options hash above but that would be obstrusive js.
or
<%= link_to image_tag(“delete.png”), { :controller => ‘products’,
:action => ‘destroy’, :id => product }, :method => :delete, :confirm =>
“Are you sure?”, :remote => true %>
Using jquery, just bind a onmouseover event to the div you want, and use
ajax to update.
I believe this is the accepted practice.
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.
–
Thank you very much !
Will try to implement it with jQuery…