Monthly Archives: May 2009

Intresting String inflections in rails

* camelcase * camelize * classify * constantize * dasherize * demodulize * foreign_key * humanize * parameterize * pluralize * singularize * tableize * titlecase * titleize * underscore camelcase(first_letter = :upper) Alias for camelizecamelize(first_letter = :upper) By default, … Continue reading

Posted in Ruby | Tagged , | 1 Comment

Render partial or view from another controller

To render view from another controller # In rail 2.3render “controller/action” # In rails 2.2 or belowrender :template => ‘controller/action’ To render partial from another controller’s views folder render :partial => “controller/partial” Cheers !Sandip

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

vi / vim Shortcuts

Open filevi filenameAs i am newb on linux macine, i dont know vi shortcuts.so, i am listing down shortcuts which i am getting familier. 🙂 Insert in filei Exit fileq forced exitq! save filewq forced savewq! Copy no of linesyy … Continue reading

Posted in General | Tagged , | 2 Comments

Working with multiple ruby versions on same server

click for original postNice post by Michael Greenly I recently changed how I’m handling multiple simultaneous Ruby installations and I’d like to share. What I needed was to make it convenient to switch between the system provided packages and specific, … Continue reading

Posted in Ruby, Ruby on Rails | Tagged | 1 Comment

Ruby 1.8.7 and rails installation on ubuntu interpid

Execute following commands in order to install ruby and rails. sudo apt-get install build-essential Below command will install all necessary packages.if you dont want any remove it from command. sudo apt-get install ruby ri rdoc mysql-server libmysql-ruby ruby1.8-dev irb1.8 libdbd-mysql-perl … Continue reading

Posted in Ruby on Rails | Tagged , | 1 Comment

Fix for ruby 1.8.7 incompatibity

Last week i moved from ruby version 1.8.6 to 1.8.7.then over a week i found that my 1.2.3 and applications developed in ruby 1.8.6 are not working in ruby 1.8.7. From lot of search on google, i found that its … Continue reading

Posted in Ruby | Tagged | Leave a comment

Rails Coding Standards

IN ESSENCE: ALL CODE SHOULD BE READABLE! # DO NOT OPTIMISE for performance – OPTIMISE FOR CLARITY OF CODE # STYLE: use 2 spaces for indent (not tabs) # STYLE: Line up hash arrows for readability # STYLE: put spaces … Continue reading

Posted in Ruby on Rails | Tagged | 4 Comments