The technique we used was quite a hack as this is something that ActiveRecord wasn’t designed to do but now in Rails 3.0 we have a new feature
Tag Archives: Ruby on Rails
deploy rails website with passenger -rails deployment
deploy rails website with passenger -rails deployment, configure a VirtualHost, restart the webserver and there you go, everything should work as expected
Ruby performance improvement of 63% in 1.9.1
Ruby is very powerful object oriented language. new Ruby performance improvement. Working with pure Ruby is really fun and interesting to me. I am real fan of Ruby language.
Ruby on Rails 3.0 released with new features
working on Ruby on Rails, daily inventing new things, trying new things and contributing to ROR community. News Ruby on Rails 3.0 released with new features
How to host multiple rails site on Nginx
Nginx famous now. We given information for how to host multiple rails site on Nginx. we given the configuration code along with their detailed information.
USA State list for Rails
Every time we need this migration script for our projects Use following command for Model generate [siwan@localhost siwan]$ ruby script/generate model UsStates exists app/models/ exists test/unit/ exists test/fixtures/ create app/models/us_states.rb create test/unit/us_states_test.rb create test/fixtures/us_states.yml exists db/migrate create db/migrate/20091117115011_create_us_states.rb [siwan@localhost siwan]$ Open the /db/migrate/20091117115011_create_us_states.rb file and paste following code: class CreateUsStates ‘Alabama’, :abbreviation => ‘AL’ UsStates.create …
Nginx Rule for Rails Application
Use following code for setting up Nginx for rails.
Install Apatana Studio on Fedora 9
Installation of Apatana in Detail 1. Download zip file from this location(http://www.aptana.com/studio/download) File name:Aptana_Studio_Setup_Linux_1.2.7.zip 2. Then uncompress the .zip file. and copy the resulting ‘aptana’ folder under ‘/home/siwan’.(siwan is my username for fedora, you have replace your username) 3. Install xulrunner (for install xulrunner user following command, Became root first) yum install xulrunner or follow …
Memcached Server with Rails
To install memcached server on linux/fedora box yum install memcached Find help for memcached commands and option memcached -help Start memcached server(11211 is default port Number for memcached server) memcached -m 500 -l 192.168.2.4 -p 11211 -vv (192.168.2.4 this is my local ip address you can cahnge that) Stop the Memcached server ps -ef|grep memcached …
deconstructing date_select in rails
// Reconstruct a date object from date_select helper form params // place this code into your application.rb file def build_date_from_params(field_name, params) Date.new(params[“#{field_name.to_s}(1i)”].to_i, params[“#{field_name.to_s}(2i)”].to_i, params[“#{field_name.to_s}(3i)”].to_i) end //You can changes order of displaying into view <%= date_select ‘from’, ‘date’ ,:order => [:day, :month, :year] %> <%= date_select ‘to’, ‘date’,:order => [:day, :month, :year] %> //goes into controller …