Posts

Showing posts from November, 2011

issue while installing rails_admin gem in ruby on rails

if we get the error while installing rails_admin for the error lib/rails_admin/config/fields/types.rb:11:in `load': Unsupported field datatype: binary (RuntimeError) we have to follow below code in config/initializers/rails_admin.rb since I don't display the binary field I put this monkey patch in my initializer: module RailsAdmin module Config module Fields module Types def self . load ( type ) return @@registry [ :text ] if ( type . to_sym == :binary ) @@registry [ type . to_sym ] or raise "Unsupported field datatype: #{ type } " end end end end end

Admin Interfaces for Rails Apps: RailsAdmin vs ActiveAdmin

The complete article is on http://batsov.com/articles/2011/11/20/admin-interfaces-for-rails-apps-railsadmin-vs-activeadmin/

What's the difference between "include" and "require" in Ruby?

The include and require methods do very different things. The require method does what include does in most other programming languages: run another file. It also tracks what you've required in the past and won't require the same file twice. To run another file without this added functionality, you can use the load method. The include method takes all the methods from another module and includes them into the current module. This is a language-level thing as opposed to a file-level thing as with require. The include method is the primary way to "extend" classes with other modules (usually referred to as mix-ins). For example, if your class defines the method "each", you can include the mixin module Enumerable and it can act as a collection. This can be confusing as the include verb is used very differently in other languages.

Difference between include and extend in Ruby on Rails

include   : mixes in specified module methods as   instance methods   in the target class extend   : mixes in specified module methods as   class methods   in the target class So is the major difference just this or is a bigger dragon lurking?   e.g. module ReusableModule   def module_method     puts "Module Method: Hi there!"   end end class ClassThatIncludes   include ReusableModule end class ClassThatExtends   extend ReusableModule end puts "Include" ClassThatIncludes . new . module_method       # "Module Method: Hi there!" puts "Extend" ClassThatExtends . module_method               # "Module Method: Hi there!"

How to Become a Computer Scientist

Computer scientists are the experts who push the boundaries of computer technology to find out how it can be improved and to help us better understand and make use of its potential. They may specialize in any of a wide range of subjects, including programming languages, hardware design, artificial intelligence, computer-human interaction and many others. Instructions 1 Take courses in high school such as computers, mathematics, science and English if you're interested in a career in computer science. 2 Take part in a placement or internship if you have the chance. You'll get to work alongside a computer scientist and see what their work environment is like. You will also get to note it as experience on your resume. 3 Obtain a bachelor's degree in computer science. Bachelor's degree programs tend to take four years to complete. Depending on the position you apply for, a degree in a related subject, such as computer engineer

Ruby on Rails Devise gem controller overrides and set routes for multiple controllers

In my ROR project I have overrides two controllers 1)registeration controller 2)session controller while setting routes for these In my routes.rb file I specified like this devise_for :users, :controllers => { :registrations => "registrations" } devise_for :users, :controllers => {:sessions => "sessions" } In above way It is not taking session controller by default it is going to Devise::sessionController just changed the routes in below way devise_for :users, :controllers => { :registrations => "registrations",:sessions => "sessions" } It is working fine.

Ruby on rails all

In following page you  can find all useful staff on rails http://railsapps.github.com/best-recommended-learning-rails-books-resources.html

RubyConf 2011 content documents and videos of speakers talks

Kindly follow the link to update your knowledge on ruby on rails ####################################### http://rubyconfindia.org/2011/talks.html #######################################

Ruby on rails fixers for testing

Fixtures  are a way of organizing data that you want to test against; in short, sample data. They come in 3 flavors: 1. YAML fixtures 2. CSV fixtures 3. Single-file fixtures For Detail information kindly follow the link #################################################### http://ar.rubyonrails.org/classes/Fixtures.html ####################################################

Streaming on ruby on rails

Follow the below link to analise Streaming on rails. ######################################################## http://api.rubyonrails.org/classes/ActionController/Streaming.html ########################################################

assets pipeline feature in rails 3.1.0

for assets pipeline documentation follow below link http://guides.rubyonrails.org/asset_pipeline.html

upgrade rails application to rails 3.1.0

Follow the below link to find guide http://davidjrice.co.uk/2011/05/25/how-to-upgrade-a-rails-application-to-version-3-1-0.html

Could not find a JavaScript runtime. See https://github.com/sstephenson/execjs for a list of available runtimes. (ExecJS::RuntimeUnavailable) Error in Rails 3.1.0 rails s

Installing node.js fixed this for me go to https://github.com/joyent/node/wiki/Installing-Node.js-via-package-manager or run the following commands on your terminal sudo apt-get install python-software-properties sudo add-apt-repository ppa:chris-lea/node.js sudo apt-get update sudo apt-get install nodejs