Re: Rails 3 link_to :remote

Matt Royer
Wed, 16 Jun 2010 15:36:48 -0000

Update for anyone that needs help in this area. I found my problem. You
might have to do the same (if you are using this function the way I am).

In my controller, I don''t know why I put this in the Index action
before. It is now in the SHOW (duh) action:

----
format.js {
  render(:update) {|page| page.replace_html ''order_div'',
:partial =>
''orders/order_show''}
}
----

I took out all of the other junk in my "link_to" in the view and only
have this now:

----
<%= link_to "#{order.name}", order, :remote => true %>
----

So I have a list of orders in a column on the left side of the screen.
There is a right border separating it and the right column. When I click
on one of the orders, it shows the order info in the right column.
Exactly what I wanted. Piece of cake now that I think about it.

Enjoy!