Forum: Ruby on Rails link_to_remote and open new window passing parameters

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
0fc60326968a0eaccf30330fe6758375?d=identicon&s=25 Juan Kinunt (kinunt)
on 2009-03-05 11:28
Hi,
I would like to implement this:
I have a view that shows a list of elements. Each element have a
checkbox. The user can select some events marking the checkbox and click
the link_to_remote "Print this elements". When this link is clicked
another window is open with only the selected events and is printed (ala
Google Maps).

I have coded the selection of items and I'm able to open a new window. I
use the link_to_remote like this:

<%= link_to_remote 'Imprimir incidencias marcadas',
{ :url => '/incidencias/popup',
  :submit => 'table'
} %>

The elements are submited properly. I know how to open the new window:

popup.rjs:

page << "window.open('/events/print', 'print',
'left=20,top=20,width=500,height=500,toolbar=1,resizable=0' );"

But I don't know how to pass the list of elements from popup.rjs to
/events/print in the new window!!

Any idea will be appreciated.
This topic is locked and can not be replied to.