Hello,
I would like to update a partial on the screen, by hovering over a
''<div>'' element, between the <div>''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..
</a>
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 ??
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.
Jim Ruther Nill
2011-May-24 07:54 UTC
Re: Ajax.Updater more options than link_to in Rails 3 ?
On Tue, May 24, 2011 at 3:26 PM, Branko Wi <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> Hello, > > I would like to update a partial on the screen, by hovering over a > ''<div>'' element, between the <div>''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.. > </a> > > 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.> > Is there a way to have the same option as in Rails 2 ?? > > -- > Posted via http://www.ruby-forum.com/. > > -- > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Talk" group. > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. > >-- ------------------------------------------------------------- visit my blog at http://jimlabs.heroku.com -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org 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.. -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.