Jquery Full Calendar with Rails3

Hi , in this article i am going to explain how to work with

jquery full calendar along with rails 3

.
Step 1 : Install the gem by typing the following command at terminal or you can add it your gem file
    gem 'fullcalendar-rails'
     bundle install
you can find full documentation of jquery full calendar from the following link arshaw full calendar
Step 2: then add the following line in your application.js file
     //= require fullcalendar
Step 3: add the following line in your application.css file
    *= require fullcalendar


Watermarks to images using Ruby


To add watermarks on image using Ruby we need RMagick

For that we need to install rmagick and require it

To require 'rmagick' we need to require 'rubygems'

For example we have myimage.jpg file in our directory


require 'rubygems'
require 'RMagick'


image = Magick::Image.read("myimage.jpg").first

mark = Magick::Image.new(image.columns, image.rows)

water_mark = Magick::Draw.new
water_mark.gravity = Magick::NorthWestGravity
water_mark.pointsize = 24
water_mark.font_family = "White"
water_mark.font_weight = Magick::BoldWeight
water_mark.stroke = 'none'
water_mark.annotate(mark, 0, 0, 0, 0, "Watermark by Sriram")

mark = mark.shade(true, 310, 30)

image.composite!(mark, Magick::NorthGravity, Magick::HardLightCompositeOp)
puts " enter the file name to save"
file_name = gets
wm = "#{file_name}.jpg".sub(/\./, "-wm.")
puts "The file is saved by the name #{wm}"
image.write(wm)


go to folder path and run

ruby watermark.rb



here my example rubycode with the file name watermark.rb and myimage.jpg are in same folder so i doesn't need to give the full path of the image
just i mentioned the name of the image

Thanks
Sriram


Connect to Remote hosts using Ruby

Asp.net Tools



You can connect to remote hosts, run commands, examine their output, transfer files, forward network connections, and do anything you would normally do with an SSH client. These we can do in ruby by using net-sssh gem



Using Helper methods in Ruby on Rails

Asp.net Tools
Helpers methods are nothing but it is a piece of code that can be called in your views to help and keep your code DRY.
We can use helpers very simple , Each controller having its own helper file.



Redmine installation in linux

Asp.net Tools
Redmine is a flexible project management web application written using Ruby on Rails framework.
it is cross-platform and cross-database.
Features
Some of the main features of Redmine are:



Build in ruby on rails

Asp.net Tools
build_association(attributes = {})

The 'build' method in associations returns a new object of the associated type. This object will be instantiated from the passed attributes, and the link through this object’s foreign key will be set, but the associated object will not yet be saved.The 'build' method for associations is described as same as the



Ruby Reference

Asp.net Tools
While using Ruby for your projects, you may need some references.
These are some references that might help you in using Ruby:

  • Language
General Syntax Rules


Github ssh keys for rails application

Asp.net Tools
After creating a rails application generally we create a repository github to deploy our application in to the github.

For deploying our application from the local system we need ssh key.
To generate ssh key in our system.



On the spot gem in rails

Asp.net Tools
Inside your Gemfile add the following:

gem "on_the_spot"

Run the installation task:

rails g on_the_spot:install



Rails with Mongod

Asp.net Tools
As per as Ror developers we knew that the default database is Sqlite3 . and we are also using Mysql,postgresql also these relational databases .Mongoid is a document oriented database. It is very easy to install
To get how to install Mongoid database and also some introduction go through this link
http://road2ruby.blogspot.com/2011/11/mongod.html


developerscode