A quick question on popup windows


#1

How the hell do you close em off after the action is completed?
Ta,
Eric


#2

I’m curious as to how to close a browser window opened as

<%= link_to(image_tag(“new_organisation.png”, :alt => ‘New’, :border =>
1), { :controller => ‘to_dos’, :action => ‘to_do_pop_up’}, :popup =>
[‘new_window’, ‘height=500,width=800’])

which performs exactly as desired within the controller on submit

And my question is =>

after the record is processed…

flash[:notice] = ‘Note was successfully created.’
if !(params[‘id’] == nil)
redirect_to :action => ‘job_dashboard’, :id => @job
else
render WHAT??? <— THIS LINE NEEDS TO CLOSE THE POP_UP
end


#3

Eric S. wrote:

render WHAT???    <--- THIS LINE NEEDS TO CLOSE THE POP_UP

end

render :text => “”


#4

Thanks Jim - that was exactly what I needed. I figured there had to be
some render method to do that - I’d never have figured render :text tho.
Thanks again.
Cheers,
Eric.


#5

Eric S. wrote:

Thanks Jim - that was exactly what I needed. I figured there had to be
some render method to do that - I’d never have figured render :text tho.
Thanks again.
Cheers,
Eric.

Well, the render :text => “string” just renders the plain text,
or sting - which happens to be a bit of JavaScript. If a user has
JavaScript disabled in the browser, it won’t work.


#6

Can’t… The only way to control a user’s browser is with javascript.
Welcome to the
wonderful world of web programming!

b


#7

Well, in my current case, I have control over whether JS is enabled - so
that’s OK. But out of interest how would we close the window otherwise?


#8

Bugger!
Thanks Guys