I have been using link_to_remote forever now. I have also been using
jquery through jrails.
I am readying my code for Rails 3.0, and am wondering what is the best
way to accomplish.
For example, I have something like this all over in Rails 2.0
<%= link_to_remote “XXX”,
{ :url => “/activities/hide_dock”, :update =>
“dock-container”, :complete => “fixDock()” }, { :class => “activities” }
%>
def hide_dock
render :partial => “/layouts/dock”
end
Now, in Rails 3.0 I am planning this
<%= raw link_to “XXX”, “/activities/hide_dock”,
{:remote => true, :class => “activities” }
%>
def hide_dock
respond_to do |format|
format.html
format.js do
??? What do I put here ???
end
end
end
My main question is since I am using jQuery, is there any point in using
RJS?
Should I just have
render :layout => false
and in hide_dock.js.erb just use jQuery code with <%= render :partial
=>%> where appropriate.