On 8 Mar 2009, at 15:04, vishy wrote:
>
> //this is where I want to display the items
>
> <% if params[:link] %>

This doesn't look right. The placeholder div with id items should  
always be there (or else your rjs will have nothing to insert into).
> <div id="items">
> <table>
> <% for item in @item %>
>        <td>
>                <img src="<%=item.image_url%>" /><br />
>                <%= item.name %>
>        </td>
> <% end %>
> </table>
> </div>
> <% end %>
>
> //RJS Template (show_items.js.rjs)
> //@items has all the items for that link. I have verified using the
> //debug statement. Now I need to pass the @items variable to the view
> //so that the items are displayed. But thats where I am erring.
>
> link = params[:link]
> @items = Item.find_all_by_link_id(params[:link])
> logger.debug "Items : " + @items.inspect
> page.replace_html :items, @items, :object => @items
>
You should be naming a partial here to render.

Fred

> //controller.rb
>  def link
>    @links = Link.find(:all)
>  end
> Any help will be greatly appreciated.
> Thanks,
> vishy
>
> >


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to