If you need users the accept the terms of services and privcay policy or your rails application there is a simple way to handle this without a database field or javascript. It's using the validation methods built into rails. Simply add the following code to your User model for example

validates_acceptance_of :terms_of_service

Then in your view add the following to your vie... continue

If your like me and use terminal on you mac you might find yourself wanting to move to a point on the line you just typed. Well there is a simple way that l know at least. Just press and hold the "Option" key and click your mouse anywhere on the line and your cursor will move there.

I know there might be a better way without going back to the evil mouse but, l just don't know it.

Google has some of the best charts on the web. If you ever wanted to have cool pie charts like google here is a simple way to do it. Simply add the following to your application_helper.rb file.

  def google_pie_chart(data, options = {})
    options[:width] ||= 250
    options[:height] ||= 100
    options[:colors] = %w(0DB2AC F5DD7E FC8D4D FC694D FABA32 704948 968144 C08FBC ADD97E...<a href="http://www.sentia.com.au/blog/rendering-google-pie-chart-in-rails"> continue</a>


Fixing the enter key in ASP.NET with jQuery

by Michael Cindrić
4 Mar 2009

One of the fundamental problems with ASP.NET WebForms is the fact that you can only have one form per page. This jumps up and bites you when you have a set of fields and a button and you want the enter key to submit the form.

In ASP.NET 2.0 they came out with a "fix" for this. You can wrap your fields in a Panel and set the default button:

``` continue


Setting up gravatar's in your rails app

by Michael Cindrić
4 Mar 2009

Gravatars allow users to configure an avatar to go with a users email address at a central location: http://gravatar.com. Gravatar-aware websites can then look up and display each user's preferred avatar, without having to handle avatar management. This makes life easy on the developer and the user only has to manage one central location.

First step is to get the plugin

ruby scr...<a href="http://www.sentia.com.au/blog/setting-up-gravatars-in-your-rails-app"> continue</a>


Timezone support in Rails 2.1+

by Michael Cindrić
3 Mar 2009

Setting up Timezone support in the past was a pain, but now with rails 2.1 and above it's easy and done in minutes. Here is what you need to do

# config/environment.rb
config.time_zone = "Pacific Time (US &amp;amp; Canada)"

# controllers/application.rb
before_filter :set_user_time_zone

def set_user_time_zone
  Time.zone = current_user.time_zone if logged_in?
...<a href="http://www.sentia.com.au/blog/timezone-support-in-rails-21"> continue</a>