[Rails] AJAX image manipulation

Jim Weir javawaba at hotmail.com
Tue Aug 8 21:32:55 GMT 2006


I have this code in a controller that returns images to my browser...with 
ROR.

  def index
    @products = Product.find_all_ pictures
  end

....this is the .rhtml..


<% for photo in @pic -%>
  <div class="entry">
    <img src="<%= photo.image_url %>"/>
    <h3><%= h(photo.title) %></h3>
    <%= photo.description %>
  </div>
<% end %>

....can someonw show me how I can return the results to AJAX?  What I want to 
do is to display  thumbnails along the bottom and when a user clicks on one 
have it a 5x7 area on the screen populated...

  Can AJAX receive resultsets from ROR?

Thanks,
Jim

_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today - it's FREE! 
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/



More information about the Rails mailing list