Monday, March 28, 2011

Weekly Diary of a Rails Developer

Day 1
Ruby on Rails Installtion

Rails installation and configuration
Installing rvm for ruby versions on same system.
Installing dependencies for rails,rvm and gems like iconv,mysql,hpricot,sqlite,nokogiri etc by using apt-get.
Solving issues found during installation.


Day 2
Model (ActiveRecord )

Using validations like validates_presence_of, validates_uniqueness_of, validates_size_of,validates_format_of etc.
Using association for specifying relationships in the tables using has_one,has_many, belongs_to etc.
Using named_scope to classify and access records. Include and joins are used to access data from tables and query data.

Day 3
View ( ActionView )

Using views in html and haml files.
Using haml with right indentation are important as the ending tag depends on this.
Including javascript/stylesheets in views by using the include and link tag respectively.
Using different types of ajax tags like link_to_function,form_remote_tag etc which is used to harness the power of javascript library.
Using Partials we can have the same view has to retained on multiple pages. The layout file is used to specify the background of the page which is made to be used for multiple pages or for just single pages by mentioning it on the controller as layout "filename".
Using Yield to insert contents on a particular layout.
Using Render to show the same page again with the parameters already present in the response while redirect is used to tranfer the response to a different function and then to a different view.

Day 4
Controller ( ActionController )

Using facility within the application that directs traffic, on the one hand querying the models for specific data, and on the other hand organizing that data (searching, sorting, massaging it) into a form that fits the needs of a given view.
Managing the layout in application that is to be used for the views from that controller.
Using access specifiers like public,private for methods on the controller.
Using filters on controller like before_filter and callbacks which are like after_create, before_save, after_save etc.

Day 5
Migration Scripts

Creating Rails migrations for creating tables , manipulating columns in it.
For specifying its data structure.
Creating up and down blocks for it.
Specific migration can be run and it can also be reverted using different migration command.
Migration files are created when a model is created also additional migration files can be created for inserting columns to table later on.

All Days
Working on git, gems

Using git for version management.
Creating account on git, uploading private keys on it,
Using git for cloning code from origin, making git repository,creating new branches, merging branches with master, pulling and pushing code from origin and to origin.
Using gems for additional features e.g.
seed_fu,
paperclip,
s3,
authologic,
facebooker,
twitteroauth,
fckeditor,
act_as_ferret,
will_paginate,
rmagick,
etc..
Using bundler and Maintaining differnt section in gemfile for development,production and testing.

On Weekend :)
Deploying App on Cloud (Heroku)

Using heroku for deploying application.
Creating application according to the heroku requiremeent as on heroku we have time limit for request and response.
Using amazon s3 for storing files as Heroku does not file storage on it. Creating rake tasks for that.
Using gems which supports heroku.
Using heroku commands,
e.g heroku logs, heroku rake etc.


Philosphy that Developer lives everyday
TDD(Test Driven Developement), DRY ( Do Not Repeat Yourself)

No comments: