[Rails] rails validates format with

2012-02-13 Thread Venkat Surabhi
I want to dynamically validate my password with validates_format_of . validates_format_of :password,:with => need to get regular expression dynamically based up on the object setting. class Admin < AR::Base validates_format_of :password,:with => lambda {|admin| admin.get_regular_exp} def get_re

[Rails] calendar date select

2012-02-01 Thread Venkat Surabhi
Hi, In my application I am using calendar_date_select gem to pickup date and time from browser. The problem I am facing is: My application server is in us and when I tried to access the application from my machine(India) the calendar_date_select returns the time of my local machin

[Rails] Paperclip preserve files ?

2012-01-25 Thread Venkat Surabhi
Hi, I am using paperclip to upload files. The problem I am facing is, based on my object property I need to preserve my file. Means my object should be deleted from db but the file need to be restored. I am using the option :preserve_files => true. If I keep the above option in mod

[Rails] Prawn : undefined method `make_table'

2010-12-01 Thread Venkat Surabhi
require 'prawn' require 'prawn/core' require 'prawn/layout' Prawn::Document.new do |pdf| subtable = pdf.make_table([[ "foo", "bar" ], [ "baz", "bax" ]], :column_widths => [ 50, 50 ]) { column(0).background_color = "808080" cells.borders = [] }