Question : Rails link_to_remote

Dear experts,

In RoR there is a function called
link_to_remote(name, options = {}, html_options = {})

where we can write an AJAX link.

This is the example for Rails API
  link_to_remote word,
    :url => { :action => "undo", :n => word_counter },
    :complete => "undoRequestCompleted(request)"

My problem is how to embed a stylesheet parameter inside link_to_remote?
In this case i would like to add a kind of style.display = 'none', so that the link become INVISIBLE.

Thanks in advance.

Answer : Rails link_to_remote

link_to_remote word,
    :url => { :action => "undo", :n => word_counter },
    :complete => "undoRequestCompleted(request),
    {:style => "display:none;"}

in link_to_remote the link_to parameters do work
so you can add a parameter to set HTML attributes on the link

Have not tested my example, so you might have to swap parameters around

cheers

Geert
Random Solutions  
 
programming4us programming4us