Wednesday, February 9, 2011

How to install ruby 1.9 and rails with RVM

Just follow these steps
ruby -v
mkdir -p ~/.rvm/src/ && cd ~/.rvm/src && rm -rf ./rvm/ && git clone git://github.com/wayneeseguin/rvm.git && cd rvm && ./install
rvm install 1.9.1
rvm list
rvm 1.9.1
rvm 1.9.1 --default
rvm system
gem install tzinfo builder memcache-client rack rack-test rack-mount erubis mail text-format thor bundler i18n
gem install rails --pre
rails topscore
cd topscore
rails server
gem install sqlite3-ruby
rails generate scaffold game name:string
rake db:migrate

and you are done :)
taken from http://railscasts.com/episodes/200-rails-3-beta-and-rvm

Wednesday, February 2, 2011

How to make a remote call synchronous in Rails

new Ajax.Request('/controller/action?username=praveen', {asynchronous:false, evalScripts:true, parameters:'page_offset=' + page_offset + '&authenticity_token=' + encodeURIComponent('e060znd6JcrMCU6Bf4ZZnfyBac4tl1YXQ6HuEHZGY58=')});

What to do to get that "asynchronous:false" thing in your link_to_remote or any other helper function available in rails :)

I know its not a big thing and there is/are very few requirements to make an Ajax call synchronous but one might face this requirement sometimes, and the answers is
<%=remote_function(:url => {:controller => "controller", :action => "action", :username => "praveen"}, :type => :synchronous, :with => "'page_offset=' + page_offset") -%>

And you are done... so now till the time this thing is taking place, everything in browser will be waiting to complete the process first and then only proceed next.
Hope you stumble on me looking in for me.

Honda Civic & A/C problems.

Hello Friends, Got a post again on to Honda Civic (The good old favorite commuter of mine). This car has been doing great except for so...