Problem with link_to_remote/render_partial and :html

first off, the javascript_include_tag for prototype is redundant, as prototype is included in the defaults.

second, try this

<div id="my_div">This will go away</div> <%= link_to_remote "Do Magic", :url => {:action => "DoMagic"}) -%>

then in your controller:

def DoMagic   render :update do |page|     page.visual_effect :fade, 'my_div', :duration => 1.5   end end

your browser will make an ajax request when the link is clicked, the server will respond with some javascript which will be evaulated and your div should fade out.

link_to_remote has three parameters, last two of which is a hash.

http://rubyonrails.org/api/classes/ActionView/Helpers/PrototypeHelper.html#M000412

So do this:

<%= link_to_remote(“Do Magic”, { :url => { :action => “DoMagic” } }, {:style=>“background-color: #0e0;”}) %>

(last parameter is the html_options)

Vish