AngularJS with Rails

1) Check the following URL for installation

2) for basics and for advance coding refer the following URL

3) for Installing/coding jasmine


Posted in javascript, rails, ROR, ruby on rails, web development | Tagged , , , , , , , | 1 Comment

spree tools and tutorials

1) deface



3) Gem

Posted in rails, ROR, ruby on rails, web development | Tagged , , , | 1 Comment

How to join and configure IRC in pidgin

you want the to collect 1)IRC Server name 2) channel name 3) and port number

example :-

IRC Server:
Port: 6667
Channel: #spree
A) Joining in a IRC channel

1) used web-based client to access the Freenode IRC network ( )

2) connected using a nickname and channel name

3) register your name and password by typeing the following command and following the email instructions

/msg nickserv register [PASSWORD] [youremail]


B) configuring in pidgin
1)In pidgin on Accounts -> Manage click add

2) use protocol IRC, enter screen name, server, password etc..

3) go to menu and select buddies->join a chat

4) Select your IRC account from the drop down

5) enter channel, password information and click join


Posted in chat, web development | Tagged , , | Leave a comment

what is rails templates ?

generators can be used inside an application, they can also be used to generate applications too, This kind of generator is referred as a “template”.


gem(“rspec-rails”, :group => “test”)
gem(“cucumber-rails”, :group => “test”)

if yes?(“Would you like to install Devise?”)
model_name = ask(“What would you like the user model to be called? [user]”)
model_name = “user” if model_name.blank?
generate(“devise”, model_name)
here we specify

1) we want to add rspec-rails and cucumber-rails gem
2) asking whether or not like to install Devise. if answer is yes devise gem is added and then runs the devise:install generator
3) asking more input from user and run devise generator


if the file called template.rb. we can use it as follows

rails new myapp -m template.rb


For Rails Template Tutorials
For Rails Templates

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

How to create a Gem file

1) bundle gem gemwork1

(My IDE has option for “Gem Application” and given the name “gemwork1” as the application name)

2) in ‘lib/gemwork1.rb’ add the functionality code


add the following code to already existing module “Gemwork1”. here we adding form validation for email field

def validates_email_address_of attr_name

email_regex = /\A[\w+\-.]+@[a-z\d\-.]+\.[a-z]+\z/i
self.validates_format_of attr_name,
:with => email_regex,
:message => “is not a valid email address”
To extend it with ActiveRecord::Base class add this too

require “gemwork1”
class ActiveRecord::Base
extend Gemwork1

where “gemwork1” is file name and “Gemwork1” is module name

3) build the gem:- gem build gemwork1.gemspec or gem build
4) to install it into your system:- rake install
5) to check the working

create a new rails project and add the following in your Gemfile:
gem ‘gemwork1’

Run bundle, generate a User scaffold with an email:string attribute and migrate the database. In your User model add a validation for a given email string

validates_email_address_of :email

Now start the server and try to create a new user with an email address like “foo”. Rails should output an validation error.

6) to publis the gem in RubyGems

want a account in during the push command it will ask email and password for sign in
gem push gemwork1-0.0.1.gem




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

Raphaël ( JavaScript library ) in rails

1) Download raphael.js ( downloaded file not worked with me. so fetched it from source code of sample works)
2) added it to the folder app/assets/javascripts
3) create a javascript file for our Raphaël code


var paper = Raphael(“sample-1”, 200, 100);
var rectPath = paper.path(“M10,10L10,90L90,90L90,10Z”);
var curvePath = paper.path(“M110,10s55,25 40,80Z”);


here “sample-1″ is dom ID presented in our view file as

<div id=”sample-1”> </div>



for more about path


for Text with custom fonts


for free javascript font


Posted in javascript, rails, ruby on rails, web development | Tagged , , , | 6 Comments

spree with Heroku and Amazon S3

A) spree installation 

1) add in gem file and bundle install
gem ‘spree’
gem ‘spree_auth_devise’
gem ‘spree_gateway’, :git => ‘git://’, :branch => “1-3-stable”

2) rails g spree:install
3) bundle exec rake spree_auth:install:migrations
4) bundle exec rake db:migrate
5)change the following line in config/initializers/spree.rb
Spree.user_class = “Spree::LegacyUser”  to    Spree.user_class = “Spree::User”
6) bundle exec rake spree_auth:admin:create
7) to change logo rename your logo to “spree_50.png” and place at
8) added extensions the extension spree_self_delivery

B) Deployment on Heroku and Amazon S3

1) underneath the other config.assets lines inside config/application.rb add
config.assets.initialize_on_precompile = false

2) To configure Spree to upload images to S3, put these lines into config/initializers/spree.rb:

Spree.config do |config|
config.use_s3 = true
config.s3_bucket = ‘<bucket>’
config.s3_access_key = “<key>”
config.s3_secret = “<secret>”

3) in config/initializers/spree.rb:

Paperclip.interpolates(:s3_eu_url) do |attachment, style|
“#{attachment.s3_protocol}://#{Spree::Config[:s3_host_alias]}/#{attachment.bucket_name}/#{attachment.path(style).gsub(%r{^/}, “”)}”

4) git push heroku master
5) heroku run rake db:migrate
6) heroku run rake spree_auth:admin:create
7) heroku run rake db:seed
8) add addon sendGrid in heroku

problem 1 :- Countries and States list not available in Spree

solution:- rake db:seed

Posted in rails, ROR, ruby on rails, web development | Tagged , , , , , , , , , | 1 Comment

Phusion Passenger,capisantro:- rails Deployment

gem install passenger



Posted in ruby on rails | Leave a comment

Error gem not installed


gem list -d rake
from the output get the installation path and execute the command as follows
gem uninstall –install-dir /home/john/.rvm/gems/ruby-1.9.3-p362@global rake -v 10.0.3

here rake is gem name and 10.0.3 version of the gem


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

Error:- ActionView::Template::Errror (application.css isn’t precompiled)

Rails assumes that you have your files precompiled in the production environment.

if want live compiling (compile at runtime) set as the following

in the file config/environments/production.rb

config.assets.compile = true
for better performance in production want to set config.assets.compile to false in production.rb

You can precompile with this rake task:

bundle exec rake assets:precompile

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