RESTful inplace edit plugin - quick fix
Thursday, November 20th, 2008RESTful inplace edit plugin is now up-to-date. We merged a bugfix from Mina Guib to avoid broken URL’s if object overrides its own to_param method.
Thanks to Mina for her input.
RESTful inplace edit plugin is now up-to-date. We merged a bugfix from Mina Guib to avoid broken URL’s if object overrides its own to_param method.
Thanks to Mina for her input.
I just stumbled over this method name:
“reset_column_information_and_inheritable_attributes_for_all_subclasses” which does not have documentation.
Why should it. The name says everything.
Rails 2.1 has pretty good support of Time Zones. It’s possible to save user-specific time zones. So if your users are from different zones, you can display the output in the corresponding zone of the user.
To set a default time zone, add config.time_zone in environment.rb. For the output, set the current time zone in before filters via application controller.
def set_zoneTime.zone = @user.time_zone if @userend
If you display timestamps in ActionMailer, you must set the Time.zone option within the ActionMailer class. Otherwise, the default settings of the database are taken (Time zone: UTC)
Rails provides nice helper methods to work with time zones. A useful method is in_time_zone(). It presents a time in any time zone.
>> t = Time.now
>> t.in_time_zone('Bern')=> Mon, 01 Sep 2008 14:47:00 +0200
Several rake task helps you to find out the possible zones:
rake time:zones:all
rake time:zones:local
rake time:zones:us
New ? Ah… not really. Would be fond to say that TLS support for ActionMailer is new. Anyway we packed up the code which is floating around on the web to add TLS support to pre Ruby 1.9 projects. Just for convenience. Find it on github.
I missed this when it first came out. Gartner sees Ruby as a mayor player for the next five years. Unfortunately, Gartner sells the content they’re producing so normal people don’t get to see it. I came across a german translation where the main points are
There’s a graph of it somewhere on the web:

Findings: The Ruby Language Will Reach 4 Million Programmers by 2013
We are slowly moving our projects from our svn repository to github. In that process we had to move a private repository from one github account to another (pulling and pushing again), still maintaining the svn part.Funny situation ocurred today. After I pulled, merged and pushed my local repository back to the new github account I have two masters!I don’t exactly know how I did this. Who knows what I get when I pull the master branch now?
Update: After I wrote this post, some background task seems to have tidied up for me. Phew. One master.
A customer of us deploys a Rails app on a Windows platform. We are using
It was a pretty straightforward process to setup and configure this stack, following one the online documentations. How happy we were when everything worked and we could hit our Rails app from the browser. Everything ? Ahhhh… not exactly. File upload did not work properly. Only one out of 10 uploads would succeed, the other would fail after around 60 seconds. The browser should an “Connection Timed Out” error message, the access and error logs of Lighty did not give much information.When we had IIS rewrite to one mongrel directly then the upload worked, so the problem was somewhere with Lighty. Digging around in the Lighttpd forums and documentation brought up following configuration options which could be relevant for fileupload:
We solved our problem by setting the server.network-backend to ‘writev‘ (a bit obscure but hey… it worked)
Webthumb is a service to create thumbnails from websites (descriptive name, isn’t it…). It creates different sized thumbnails by default and you can request custom sizes.It offers an API to access it’s services and we wrapped up some code i wrote while on vacation and bundled it as a gem.The code is still a bit clumsy (as i wrote it on vacation :-) ) but it works nice for us. There is already another ruby wrapper for the API but it is not available as a RubyGem and does not expose some of the latest webthumb functionalities so we decided to write our own library. Josh gave us some extra credits so we could develop the API. Thanks. The gem is available on Simplificator’s github repo. To install do following:
sudo gem update --system (in case you are not yet on version 1.2.0 or higher)
sudo gem sources -a http://gems.github.com (only once)
sudo gem install simplificator-rwebthumb
To create thumbnails:
require 'rubygems'
require ‘rwebthumb’
include Simplificator::Webthumb
# main access point for the Webthumb API
wt = Webthumb.new(’YOUR API KEY HERE’)
job = wt.thumbnail(:url => ‘http://simplificator.com’)
job.write_file(job.fetch_when_complete(:large), ‘/tmp/test.jpg’)
For more info check the README file and (currently) the source code. All the features from a the request element are supported but currently not documented. I’ll look into that in some days.If you want to use the Gem you’ll need an account for webthumb. You’ll get 100 free credits every month so it’s easy to try it out.
Just a short note to direct you to a great post over at rubyonrails.com (some days old, i know…but i can not in the office right now and can not access the internet everyday. Yes… this exists :-) ). Chuw Yeo June wrote about API changes and performance tests. The API gets some new methods which make your life easier and at the same time are a bit confusing. Sample ? Here you go:
Object.present? method was added which is the same as not Object.blank? which is the same as Enumerable.any?
Three ways to do the same thing (as long as you are working on Enumerable). I think this is confusing and clutters the API.