Monthly Archives: November 2011

Rails 3 link_to (:method => :delete) not working rails 3.0-jQuery

1) Install gem ‘jquery-rails’, ‘>= 1.0.12’  and bundle 2)  rails generate jquery:install 3) add to application.html.erb <%= javascript_include_tag :defaults %> Source https://github.com/rails/jquery-ujs http://www.klairvoyant.in Advertisements

Posted in rails, ROR, ruby on rails, web development | Tagged , , | Leave a comment

for create different version of rails 3 project

Solution rails _3.0.8_ new myproject -d mysql where  -d for mentioning what database we use http://www.klairvoyant.in

Posted in rails, ROR, ruby on rails, web development | Tagged , , | Leave a comment

Rails 3.1 Error while – heroku rake db:migrate

solution Added these to Gem file. since using mysql for development and test required mysql and for heroku(production) required postrgessql group :development, :test do gem ‘mysql2’ end group :production do # gems specifically for Heroku go here gem “pg” end … Continue reading

Posted in rails, ROR, ruby on rails, web development | Tagged , , | Leave a comment

ERROR: Failed to build gem native extension while installing mongrel.

Solution Mongrel 1.1.5 is not compatible with Ruby 1.9.x install mongrel – -pre   http://www.klairvoyant.in

Posted in rails, ROR, ruby on rails, web development | Tagged , , | Leave a comment

ActionController::RoutingError (No route matches “/stylesheets/scaffold.css”) while in production mode

default Rails 3 / webrick don’t server static files in production mode. You want to set config.serve_static_assets = true    in your production.rb file. source http://stackoverflow.com/questions/4928490/rails-production-static-files-routing-error http://stackoverflow.com/questions/3410956/rails-404-error-for-stylesheet-or-javascript-files http://www.klairvoyant.in

Posted in rails, ROR, ruby on rails, web development | Tagged , , , | Leave a comment

Running migrations for production and test databases – rails

On console set RAILS_ENV=production rake db:migrate RAILS_ENV can be 1)test,2)development,3) production On Linux, use “export RAILS_ENV=production” instead of set command. Source 1)http://www.tutorialspoint.com/ruby-on-rails/rails-migrations.htm http://www.klairvoyant.in

Posted in rails, ROR, ruby on rails, web development | Tagged , , , , | Leave a comment

Pagination with kaminari in rails 3

1) put in Gemfile  gem ‘kaminari’   and bundle it 2) In controller type the code @maps = Map.page params[:page] example def showall @maps=Map.all end will be replaced like def showall @maps = Map.page params[:page] end 3) in showall.html.haml type the … Continue reading

Posted in rails, ROR, ruby on rails, web development | Tagged , , , | Leave a comment

Adding More RESTful Actions in Rails 3

Adding Member Routes To add a member route, just add a member block into the resource block: option 1 resources :photos do member do get ‘preview’ end end option 2 resources :photos do get ‘preview’,   : on => :member … Continue reading

Posted in rails, ROR, ruby on rails, web development | Tagged , , | Leave a comment

Open Source Ruby On Rails Applications

Links 1) http://blog.chrislowis.co.uk/2010/05/31/five-rails-apps-to-study-and-learn-from.html 2)http://www.webresourcesdepot.com/23-amazing-and-open-source-ruby-on-rails-applications/ http://www.klairvoyant.in

Posted in rails, ROR, ruby on rails, web development | Tagged , , | Leave a comment

IDE for rails

1)RubyMine  http://www.jetbrains.com/ruby/buy/index.jsp 2) NetBeans http://netbeans.org/index.html 3) Aptana Studio 3 http://www.aptana.com/products/studio3 4)Eclipse http://www.eclipse.org/downloads/ 5) Komodo IDE http://www.activestate.com/komodo-ide   http://www.klairvoyant.in

Posted in rails, ROR, ruby on rails, web development | Tagged , , , | Leave a comment