Monthly Archives: November 2009

Manual active record db connection in ruby using mysql adapter

Here is the code to make manual connection with database require ‘active_record’ActiveRecord::Base.establish_connection( :adapter => “mysql”, :host => “localhost”, :username => “root”, :password => “abcd”, :database => “funonrails” ) Load database configurations from yml file dbconfig = YAML::load(‘database.yml’))ActiveRecord::Base.establish_connection( dbconfig ) Advertisements

Posted in Ruby on Rails | Tagged , | 2 Comments

Writing rake task in rails with namespace, parameters

Rake tasks itself defines that “they are bunch of ruby code that performs some task.”Rake tasks are placed in lib/tasks directory of application and files have .rake extension.There are many lovable tasks defined in rails. read moreRake tasks are executed … Continue reading

Posted in Ruby on Rails | Tagged , | Leave a comment

Understanding and creating radinat extensions

Understanding and creating radinat extensionsTo start with, first of all lets know what is radiant and why to use it ?Radiant is a open source content management system designed that serves cms needs forsmall organisationsCreating new radint application radiant -d … Continue reading

Posted in CMS, Radiant, Ruby on Rails | Tagged , | Leave a comment

Capistrano + Nginx + Thin deployment on Linode

This was long lost post I had written about 8 months ago (converted from wiki to HTML – so pardon typos if any) Terminologies Capistrano is a ruby gem which helps in remote deployment. As against widely known convention, Capistrano … Continue reading

Posted in Ruby on Rails | Tagged , , , | 5 Comments

Linux commands for remote access, compress, decompress

Remote Login============ssh client is a program for logging into remote machine and execute commands.ssh [-l login_name ] hostname | user@hostname [command ]other optionsssh [-afgknqstvxACNTX1246 ] [-b bind_address ] [-c cipher_spec ]  [-e escape_char ] [-i identity_file ] [-l login_name ] … Continue reading

Posted in General | Tagged , , , | Leave a comment

Cucumber Configuration with Radiant

Configuring cucumber with Radiant Application: The command  > ruby script/generate cucumber does not succeed in case of Radiant application. Issues encountered: The command  >ruby script/generate cucumber cannot be executed. It gives error “Couldn’t find ‘cucumber’ generator” Possible reason & solution: … Continue reading

Posted in CMS, Radiant, Ruby on Rails | Tagged

Variables initialization, assignments and swapping in ruby

Just a single line variable swap in ruby x,y=y,x Example: irb>> x = “Fun” => “Fun” irb>> y = “Rails” => “Rails” irb>> x,y = y,x => [“Rails”, “Fun”] irb>> p x “Rails” => nil >> p y “Fun” Variable … Continue reading

Posted in Ruby | Tagged | Leave a comment