Ruby on Rails Tips

Why Your Controller Methods Should be Private

Ruby on Rails Tips

Most of your controller methods are public actions that display pages on your website. Your app’s routes will point to these methods and show the corresponding page (view). For example: But hopefully you are keeping things modular and breaking up complexity into smaller methods. For example, you might want to perform some check before you [...]

Read the full article →

Use Ruby’s ‘autoload’ instead of ‘require’ for your Ruby and Rails Apps

Ruby on Rails Tips

When googling to find the answer to a ruby (or rails) coding problem, it struck me that code snippets always use “require” to include any necessary libraries. For example, I recently searched for a way to compare IP addresses using CIDR notation. (I had IP ranges stored in CIDR notation and wanted to see if [...]

Read the full article →