Monthly Archives: February 2011

What is Heroku ?

Heroku is a multi-tenant platform and hosting environment. Your app doesn’t need its own servers, slices, or clusters, and you’ll benefit from continuous platform improvements. For Implementation go to http://devcenter.heroku.com/articles/quickstart For Example; we implemented a ruby on rails application at … Continue reading

Posted in ruby on rails | Tagged | Leave a comment

Blueprint with rails

1) put the files screen.css, print.css and ie.css into public/stylesheets/ 2) add the following to your layout file <%= stylesheet_link_tag “yourcss”,”screen” %> <%= stylesheet_link_tag ‘print’, :media => :print %> <!–[if lt IE 8]><%= stylesheet_link_tag ‘blueprint/ie’, :media => ‘screen’ %> <![endif]–> … Continue reading

Posted in ruby on rails | Tagged | Leave a comment

uninitialized constant ApplicationController -error

Reasons 1) The file application.rb is not present 2) you’ve just upgraded your Rails stack to 2.3. the application controller is no longer called application.rb Now it’s referred to as application_controller.rb. to solve this problem, 1) rename the file “application.rb”  … Continue reading

Posted in rails, ruby on rails | Tagged | Leave a comment

jQuery with Rails

1) put jquery.js into public/javascripts. 2) add <%= javascript_include_tag :defaults, “jquery” %>. to your layout file. 3) add the following to your javascript file. jQuery.noConflict() That will call jQuery.noConflict(), which relinquishes control of the $ alias to Prototype. 4) use … Continue reading

Posted in rails, ruby on rails | Tagged , | Leave a comment

undefined method `reenable’ for

Issue: When you run ‘rake db:migrate’ on Ubuntu, or some other Debian based distro you get the error message: “rake aborted! undefined method `reenable’ for <Rake::Task db:schema:dump => [environment]>:Rake::Task”. Solution: You need to uninstall the rake package that Ubuntu/debian installs.  … Continue reading

Posted in rails, ruby on rails | Tagged , | Leave a comment

pessimistic operator in ruby

RubyGems provides a operator ~> (read: approximately greater than) called  pessimistic operator . gem ‘library’, ‘~> 2.2’ ‘~> 2.2’ is equivalent to: [‘>= 2.2’, ‘< 3.0’]. Or it’s a short form of  ‘>= 2.2’, ‘< 3.0’. why we called it’s … Continue reading

Posted in ruby on rails | Tagged | Leave a comment

ActionController Invalid Authenticity Token error while Using Ajax On Rails

Error code <%= javascript_include_tag :defaults %> <p><a href=”#” onclick=”updater(  )”>Update with Ajax.Updater</a></p> <p id=”response2″></p> <script type=”text/javascript”> function updater(  ) { new Ajax.Updater(‘response2’, ‘/chapter2/myresponse’); } </script> Solution <%= javascript_tag “window._token = ‘#{form_authenticity_token}’” %> <%= javascript_include_tag :defaults %> <p><a href=”#” onclick=”updater(  )”>Update … Continue reading

Posted in rails | Tagged | Leave a comment

Useage of "-" with end delimiter in rails

why we use <% -%> instead of <% %> Eg <% users.each do |user| %> the output contain blank line (in two places) as shown below. to prevent this , use “-” with the end delimiter. <ul> <li> Tim </li> … Continue reading

Posted in rails | Tagged | Leave a comment

Disableing the layout for a specific view file

1)layout ‘account’, :except => :login where “account” is layout file name and “login” is the action on which the view(login.rhtml) file is called 2)render :layout => false you could do this in the method you wish to lack a layout: … Continue reading

Posted in rails | Tagged | Leave a comment