|
shopvac4christ posted:In C# I have the '??' operator, which when used like 'a ?? b', returns a unless it is a null object, in which case it returns b. Is there anything like that in Ruby?
|
# ¿ Aug 29, 2007 00:36 |
|
|
# ¿ May 3, 2024 21:23 |
|
Hop Pocket posted:I've been using my free time to code some RoR apps, and it's going fairly well. I have a dreamhost account that uses FastCGI to run the rails apps. When I deploy using Capistrano, there's a 10-15 second delay which is I'm assuming the FastCGI processes restarting because of the application change. However, if I check the deployed site after an hour or two of inactivity, I get the same delay. That is the cause of the delay and the solution is a script that loads the site every X minutes. From the Dreamhost wiki: http://wiki.dreamhost.com/Ruby_on_Rails#Switching_to_FCGI_with_Dreamhost See the section "Preventing timeouts using curl and cron" freeb0rn fucked around with this message at 20:41 on Nov 10, 2007 |
# ¿ Nov 10, 2007 20:37 |
|
Does anyone know if I can figure out within an action (in a controller) if the action has been called "remotely" (all AJAX-like) or not? Apart from sending some sort of special parameter when you update remotely and figuring it out on your own, that is. EDIT: Apparently this is done by inspecting the Accept header and using respond_to, which is what I thought but hadn't figured out how, exactly. This little excerpt I found sheds some more light on the situation: quote:If an old browser submits this form, we'll have it done through a plain old POST, which the browser sends along with a header like "Accept: */*". That means "I don't care what kind of response you give me, just give me something". Since the browser doesn't care, we'll decide what to do on the order of the type declarations. The first is type.html, so that's what we'll perform, which in this case simply instructs the browser to go back to the index. freeb0rn fucked around with this message at 06:54 on Feb 28, 2008 |
# ¿ Feb 28, 2008 06:39 |
|
Yeah I'm using that second approach.
|
# ¿ Feb 29, 2008 00:29 |