On Tue, May 24, 2011 at 3:26 PM, Branko Wi <[email protected]> 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 [email protected].
> 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.
>
>


-- 
-------------------------------------------------------------
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 [email protected].
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.

Reply via email to