How the hell do you close em off after the action is completed? Ta, Eric
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 Eric Sloane wrote:> How the hell do you close em off after the action is completed? > Ta, > Eric
Eric Sloane wrote:> render WHAT??? <--- THIS LINE NEEDS TO CLOSE THE POP_UP > endrender :text => "<script>window.close()</script>" -- Posted via http://www.ruby-forum.com/.
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. Jim wrote:> Eric Sloane wrote: > > >> render WHAT??? <--- THIS LINE NEEDS TO CLOSE THE POP_UP >>end > > > render :text => "<script>window.close()</script>" >
Eric Sloane 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. -- Posted via http://www.ruby-forum.com/.
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? Jim wrote:> Eric Sloane 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. >
Can''t... The only way to control a user''s browser is with javascript. Welcome to the wonderful world of web programming! b Eric Sloane wrote:> 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? > > Jim wrote: > >> Eric Sloane 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. >> > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails
Bugger! Thanks Guys Ben Munat wrote:> Can''t... The only way to control a user''s browser is with javascript. > Welcome to the wonderful world of web programming! > > b > > Eric Sloane wrote: > >> 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? >> >> Jim wrote: >> >>> Eric Sloane 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. >>> >> >> _______________________________________________ >> Rails mailing list >> Rails@lists.rubyonrails.org >> http://lists.rubyonrails.org/mailman/listinfo/rails