12 January 2009

Using subversion client with Net Beans 6.5 and Tortoise 1.5.x

I recently upgraded my Net Beans to it’s 6.5 version and Tortoise to 1.5.x. Since then my subversion client is not working and showing an error message as “please get a newer Subversion client”. The fix is the following one:

Go to Tools=>Plugins=>Available Plugins and install Subvesion 1.5 for windows bridge.

If it does not fix your problem then,

Go to Tools=> Options=> Miscellaneous=> Versioning=> Subversion. You will find an input field to specify SVN home folder. You can specify where you installed your latest Subversion client software here

Technorati Tags: ,

10 January 2009

Setting user defined time zone in Rails 2.1

Time zone support in rails is now easier than ever. You can set your time zone dynamically based on users information.

Here are the steps:


In configuration file, config/environment.rb add the following line
config.time_zone = "UTC"

You can prompt from user for their time zone and save it in the database for future reference. For the population of time zones in the dropdown list add the following line in you *.rhtml file:

<%= time_zone_select "user", "time_zone", TimeZone.all%>

Save this data in the database field.
When the user will be logged in fetch the time_zone from database and set it at Time.zone.
def set_timezone(time_zone)
Time.zone = time_zone
end

To persist it every where make sure to call it:
set_timezone(@logged_in_user.time_zone)

That’s it!