Archive for March, 2008

Monday, March 31st, 2008

Regular expression checking of landline/mobile UK numbers in Ruby on Rails

Problem
You want to have validations for phone numbers in Ruby on Rails code.
Solution
The mobile numbers in UK should start with a 0, followed by 7, then a number between 5 and 9, and finally another 8 numbers.
For the landline numbers in UK the number should start with 0, followed by either 1 and 8 or [...]

No Comments » - Posted in ruby on rails by kosmas

Wednesday, March 19th, 2008

Red Box progress indicator with active_scaffold_upload branch

Problem
You need to display a splash screen when uploading files to a Ruby on Rails application.
Solution
My model:
class Number < ActiveRecord::Base
file_column :intro
file_column :vmail
end
The steps I have followed.

Install redbox plugin from project path run:
./script/plugin install svn://rubyforge.org/var/svn/ambroseplugins/redbox

If files redbox.js, redbox.css and redbox_spinner.gif haven’t been copied over to the public folders copy them over manually [...]

No Comments » - Posted in ruby on rails by kosmas