Posts filed under 'rails'

How to get Ruby Native gems to install on your windows machine

The bane of any ruby/rails developer on a windows box (apart from piddling performance) is seeing the dreaded …
‘gem install error – ‘cl’ is not recognized as an internal or external command’

No more!
Devkit, a tool used by the folks who create the Windows Ruby Installer of each version of ruby helps you with (most) gems that need to be built natively.
Muchos Gracias to them for graciously providing it to us.

1 comment January 9th, 2011

How to turn off Length Error messages on Password Confirmation fields in Authlogic

In Authlogic, if you use a password confirmation field (when creating a new user perhaps), there is an error message that shows up for that field if the User model does not validate.
Something like

is too short (minimum is 4 characters)

Seems simple enough to turn off, but I almost went mad trying to figure out how do this without completely turning off password authentication.

class User < ActiveRecord::Base
    acts_as_authentic do |c|
         c.merge_validates_length_of_password_confirmation_field_options  :allow_blank => true
    end
end

PS: It’d be nice to get all the configuration options for Authlogic in one place, with better documentation for each one.
Maybe I should get on that … it is open source software after all

Add comment August 30th, 2010

Running thin instead of mongrel with script/server

Just go to the the rails directory that corresponds to this one on your computer (This is on a windows XP machine, but you should be able to figure out the right path on your machine)

C:\ruby\lib\ruby\gems\1.8\gems\rails-2.3.5\lib\commands

Open up server.rb

And edit the line that says

server = Rack::Handler::Mongrel

to say

server = Rack::Handler::Thin

enjoy

thin server logo

Add comment April 12th, 2010

How to add updated_at and created_at (timestamps) columns to an existing table in rails

From Rails Guides …

change_table :products do |t|
  t.timestamps
end

Add comment December 23rd, 2009


I recommend

Linode VPS's for Rails hosting
Heroku for mindless Rails hosting
Site 5 for shared Rails hosting and all round great service

Posts by Category

Calendar

February 2012
S M T W T F S
« May    
 1234
567891011
12131415161718
19202122232425
26272829  

Posts by Month