Posts tagged Rails

This is a semi-active blog. Once I write a post, I usually never update them. If you will read through some of these and try to follow them, please do so at your own risk. Technology changes quickly. Established languages are not as cool as they used to be. Some tutorials written several years ago may no longer work and do not reflect present day best practices.

Rails 3.1 Stable Notes


Obviously, it works. I use both Rspec and Cucumber. If sufficient tests are written for your application, knowing what doesn't work anymore isn't a problem if you want to upgrade from 3.0.x or 2.x versions of Rails.

Continue reading »

Timeline Fu

ruby rails

Realized nearly all of my projects involved logging user actions and having news feeds similar to Facebook. Two years ago, it didn't seem sensible to use a gem for just that because all you need is to create a module and helpers to log actions (on your model of course). A common mistake is adding code for logging actions, sending emails on controllers. Sometimes when you are young, you do stupid things.

Continue reading »

Don't Forget Ruby's Send Method

ruby rails

Goal: we want to display the logo of Twitter, Facebook and Google along with the links if the user is not authenticated (has not successfully authorized the application to access and write data to the third party service) or if the user is not a current user.

Continue reading »

What You Should Know Before You Upgrade Your Rails 3 App To Rails 3.1 Beta

rails ruby

There were many issues. But they aren't much compared to the benefits you'd get from using the latest version. Rails 3.1 takes away a lot of pain. Instead of using asset packager, having sprockets makes it so much easier to deploy an optimized application. Not all frameworks have this. In fact it hasn't been a practice of certain developers to make sure that a single file is loaded for javascript in production and a single is loaded for stylesheet in production. Reversible migrations is another cool thing. Also read that there is no need to add ":multipart=>true" on a form if you use the file field.

Continue reading »

SCSS Mixins

scss rails

For Ruby projects (Rails or Sinatra), I've used HAML without SASS until they introduced SCSS. I did use SASS for a re-write project in 2009. But I felt that the syntax is strange and somehow I don't mind the braces. It's also easier to just copy CSS code onto a SCSS file. Of course some would say that I could just find and replace those braces, but ultimately it's a matter of choice. I love those braces so I use SCSS. :)

Continue reading »

How to Use jQuery For Rails 3

rails3 jquery

That is it! Advantages of this code over the previous code is obvious. It's not obtrusive and it works. Congratulations to all of us. We're no longer living in caves and eating whatever exists in the wild. We actually have a choice.

Continue reading »

Hello! I am Kat. I've been a developer for several years. When I'm not sitting down, reading and working for long hours, I am traveling to some place of interest.
If you want to reach out, you can send me an email or add me up on Google Plus.