RailsCasts Pro episodes are now free!

Learn more or hide this

Mike Goggin's Profile

GitHub User: toskies

Site: http://tosker.com

Comments by Mike Goggin

Avatar

As always, good information. I use pry on a daily basis in both Rails and POR apps. Great tool for effective debugging.

Avatar

I found this blog post on GitHub about their transition from nginx/haproxy/mongrel to nginx/unicorn. Sounds intriguing.

https://github.com/blog/517-unicorn

Avatar

I'm pretty curious myself. I'm getting ready to do some hard profiling on our multiple apps at work to try and find the best setup for performance.

Anyone have any benchmark information on using Unicorn/nginx over Passenger/Apache?

Avatar

It depends on how much control you want over your environment. If you're not expecting your app to have to scale much, you might go with a VPS. However, if you're expecting the app to grow rapidly and for your userbase and daily record commit to increase by a large margin, you might consider a hosted solution like Heroku or EngineYard. Both of those solutions scale very well up and down.

Avatar

Once you're ssh'd in you should just be able run irb at the command prompt.

Avatar

I've used three different VPS solutions and each are pretty good. They all provide different features for their price points as well.

  • ChicagoVPS - They offer a few solutions which are reasonably priced. OS options are somewhat limited. I'm pretty sure you're locked into CentOS 5.

  • ChunkHost - ChunkHost is slightly more expensive, but offers more options. OS options available are: Ubuntu (8.04 LTS, 10.04 LTS, 10.10), Debian (lenny, squeeze), and CentOS (5, 6). They're offering a free VPS for a limited time as a "beta test." Good for testing.

  • Linode - Linode is my ol' standard. I've used them for years and have never been disappointed. They offer several solutions and have quite a few features that the others don't have. They also offer flexibility with your Linode (add more storage or an extra IP instantly). OS options available are pretty much anything you can think of. Each option available also comes in a 64-bit flavor if that's your preference (or requirement).

Avatar

You would be able to see them, yes. That's why it's best to secure your controller actions as well as your views to ensure that, even if someone disabled styling or if they typed in the path to those actions explicitly, they would be unable to access that functionality.

I prefer not hiding things with CSS, myself; using JavaScript instead to add those dynamic elements to the DOM after the cached page has loaded.

Avatar

As you guessed, the bang on the find_by_subdomain method is so it will raise RecordNotFound if the given subdomain does not exist.

A benefit of this would be so you could rescue_from RecordNotFound in the ApplicationController (or a specific controller) and redirect the user to another page with a flash message.

This has the added benefit of keeping your code DRY so you don't dirty up your controller actions by checking for a valid result and taking action accordingly.