Possible to use rails for a popup?

From Rails API Docs, link_to Examples:

link_to "Busy loop", { :action => "busy" }, :popup => ['new_window', 'height=300,width=600']

'height=300,width=600' is a string of JavaScript Propertiesfor the Popup, so you can define other JavaScript Properties for the popup as well.

then define the "busy" action in your controller, and render a view for it. you might want to define a different layout for the popup as it should not use your default template with navigation and stuff ...

def busy   ...do stuff here...   render :action => :busy, :layout => :popup end

3) then create

3.1) a popup.rb in your app/views/layout folder for the popup with the basic HTML strcuture (like you do in the application.rhtml layout and <%= content_for_layout %> you can re-use this layout for other popups... 3.2) a busy.rhtml view in the view/yourcontroller directory, which will render the content for the popup layout ....