in my rails 2 app I had,
<%= link_to_remote image_tag(img.public_filename(:small), :alt =>
“Thumbnail”, :size => “50x50” ), :url=>{:controller=>“vehicles”,
:action=>“get_thumbnail”, :id=>img.id} %>
and in my controller
def get_thumbnail
@image = Image.find_by_id(params[:id])
render :update do |page|
page[“vehicle_images”].replace_html :partial=>‘main_image’
end
end
Now I am using JQuery and have updated the link_to tag as:
<%= link_to(image_tag(image.image_url(:thumb), :alt => “Thumbnail”),
{:controller=>“vehicles”, :action=>“get_thumbnail”, :id=>image.id},
:remote=> true) %>
And am having difficulty as to what modifications I need to make to the
controller code. Doing some research on google I may need to add a
.js.erb file but I am not that clear.
Please help.