Posts

Showing posts from August, 2011

How to find company is register or not ?

Just go to the below link and enter your company name http://mca.gov.in/DCAPortalWeb/dca/MyMCALogin.do?method=setDefaultProperty&mode=31 -

Open source rails projects

http://www.opensourcerails.com/

ruby on rails jobssite

http://www.rubyonjobs.com/

rvm(Ruby version management) guide

RVM guide Please go follow the below url for documentation. http://beginrescueend.com/rvm/basics/

Frequently used Heroku commands

Create project in ror Open git console Change to project directory Enter command heroku create To rename the heroku project , heroku rename < new name > --app <old name> To add project to git repository git init                                                       Note:It should enter at the first time only(no need after every  modification)                                               git add .                                               git commit -m "<comment>"                                               git remote add < name > git@heroku.com :< project name >.git     Note:It should enter at the first time only(no need after every  modification)                                                git push < name > master To clone an existing project from git  git clone git@heroku.com :< project name >.git Before changing database, application should be in maintenance mode                               heroku main

heroku commands and usages

***********************About heroku ***************************************************************** heroku help                                       # show list of commands with description heroku version                                    # show the gem version of heroku using ***********************User acount comands*********************************************************** heroku login                                      # log in with your heroku credentials heroku logout                                     # clear local authentication credentials ***********************heroku application basic information ***************************************** heroku list                                       # list your apps heroku create [<name>]                            # create a new app heroku info                                       # show app info, like web url and gitrepo heroku open                                       # open the app in a web browser heroku rena

ssh key generation

ssh-keygen -t rsa -C " your_email@youremail.com "

All git commands

    git help command     or git command --help     //Show help for a command ************************Repository creation: ************************ git init     //Create a repository in the current directory git clone url     //Clone a remote repository into a subdirectory ***************************File operations:**************************** git add path                     //Add file or files in directory recursively git rm path                     //Remove file or directory from the working tree       -f                     //Force deletion of file(s) from disk git mv path destination     //Move file or directory to new location       -f                     //Overwrite existing destination files git checkout [rev] file     //Restore file from current branch or revision       -f                     //Overwrite uncommitted local changes ********************************Working tree:******************************* git status             //Show status of the working tree git diff

pre-requisites for refinerycms

-- ##########################Total ROR with Refinerycms######################## #########   Prerequesits For Refinerycms project work ##### 1)-- Install Ruby    ---- This is for Redhat Linux system Follow the steps told in :- http://www.redhat.com/magazine/025nov06/features/ruby/ 2)-- Install Ruby Gems run the command in command line given below   1)gem update system above command will install gem package from rempte repositery   3)-- Installing Rails framework run the below commands    1)gem install rails above command will install the rails framewok and rdoc of rails successfully 4)-- Install one of the database and its gems     By Default sqlite3 is used   for other you should ensure thet that database is already running   if not install first than install related gem from remote repositery for that run command  1)gem install gem_name  ex:- gem install mysql -heroku 5)-- check that ImageMagick is installed    In Linux, it is installed by default checkit by the command    1)i

getting started with Refinerycms

-- ###################### Working with git & heoku in Refinery cms ##################### 1)--prerequesits   first complete all 9 steps listed in Prerequsits for Refinerycms file   othrwise check 1)ruby is working          2)check rails is working          3)check database and that database gem is working                  4)check Image magic is working          5)check Git is working          6)check RVM is working          7)check refinerycms is working 2)-- creating refinerycms project you can create project by the command refinerycms project_name ex:- refinerycms practice1             //enter command in command promt       create  log/development.log       create  log/test.log       create  public       create  public/404.html       create  public/422.html       create  public/500.html       create  public/favicon.ico       create  public/index.html       create  public/robots.txt       create  public/images       create  public/images/rails.png       create  public/style

Ruby on Rails performance scaling

Performance scaling web link for video tutorials are here Ruby on Rails performance scaling                                                                                 

how to upgrade frm rails 2.8 to 3 and ruby 1.8.7 to 1.9.2

 how to upgrade frm rails 2.8 to 3 and ruby 1.8.7 to 1.9.2 I'm sure you'll hear an echo chamber here of "Use rvm"! http://beginrescueend.com Follow their directions to the letter, and all will be well.

Rake issues in ruby on rails

I'm having a really frustrating issue: Rake is being dumb. Here's how the problem comes about: $ rails new test_app $ rails generate scaffold new_scaffold field1 : string field2 : text Both of those work just fine, but then when I do this, $ rake db : migrate I get the following error. ( in / home / mikhail / test_app ) rake aborted ! uninitialized constant Rake :: DSL / usr / lib / ruby / 1.9 . 1 / rake . rb : 2482 : in `const_missing' /usr/lib/ruby/gems/1.9.1/gems/rake-0.9.0/lib/rake/tasklib.rb:8:in ` < class : TaskLib > ' /usr/lib/ruby/gems/1.9.1/gems/rake-0.9.0/lib/rake/tasklib.rb:6:in `<module:Rake>' / usr / lib / ruby / gems / 1.9 . 1 / gems / rake - 0.9 . 0 / lib / rake / tasklib . rb : 3 : in `<top (required)>' /usr/lib/ruby/gems/1.9.1/gems/rake-0.9.0/lib/rake/rdoctask.rb:20:in ` require ' /usr/lib/ruby/gems/1.9.1/gems/rake-0.9.0/lib/rake/rdoctask.rb:20:in `<top (required)>&#

how to stop marquee on mouse over

maqquee stop < marquee onmouseover= "this.setAttribute('scrollamount', 0, 0);" onmouseout= "this.setAttribute('scrollamount', 6, 0);" > my text here </ marquee >

How to use rails.js and prototype.js librarys

The problem I wanted to use some interface element in Rails that requires prototype.js so I had to have both librairies. The problem is that there's a conflict between them. Prototype.js doesn't seem to give a damn about it but jQuery is nicer with you. It offers a noConflict method. With Rails , prototype.js is the default librairie so to override this, you could do <%= javascript_include_tag "prototype", "jquery" %> <script>$j = jQuery.noConflict();</script> This way, you will have to use $j instead of $ to call jQuery. $ would still call prototype. Another thing you could do is to use jQuery on Rails and don't give a damn about scriptaculous. I personally prefer to use librairies that are fully tested instead of using a "by-pass" that could break my code. It's your choice… --                                                                                    G SubbaRao                              

Conditional search in Ruby On Rails

For Conditional search in ror I have the following model:   create_table "users" , : force => true do | t |     t . string   "name"     t . string   "url"     t . integer   "clicks_given"     t . integer   "clicks_received"     t . datetime "created_at"     t . datetime "updated_at"   end and I have defined this method for the model:   def credits     credits = self . clicks_given - self . clicks_received   end Pass the condition as an array instead of a hash: @users = User . find (: all , : conditions => [ "clicks_given - clicks_received >= ?" , - 5 ])

Blog view modification in Ruby On Rails

Yes, if you clone RefineryCMS and then clone the blog engine inside vendor/engines/ then you should be fine (ve.g. you'd end up with vendor/engines/refinerycms-blog/ ) Make sure you tell it the new location of the blog engine once you have it pulled locally though.. e.g.     gem 'refinerycms-blog', :path => 'vendor/engines/refinerycms-blog' Or you could install both per normal and run these tasks: rake refinery:override view=**/* rake refinery:override controller=**/* rake refinery:override model=**/* Though that way will just copy the files wherever which may be a disadvantage.

Blog creation in Ruby On Rails

Hello. I use Rails 3. I installed 'refinerycms-blog': 1.) In a Gemfile: gem 'refinerycms-blog', '~> 1.0.rc15' 2.) bundle install 3.) rails generate refinery_blog 4.) rake db:migrate It works very good, but if I go to any post page - I see HTML tags and content. I deployed my project to heroku, where you can see it. http://russlteam.heroku.com/blog/ You can see this problem in a each post in a blog. For example: http://localhost:3000/blog/mysql-for-beginners

sqlite3 installation in Ruby On Rails

I'm having issues installing the sqlite3-ruby gem on crunchbang linux. After googling the past few hours and following several people with the same problem, I still haven't gotten it to work. Here is what I see after trying a 'sudo gem install sqlite3-ruby' Building native extensions. This could take a while... ERROR: Error installing sqlite3-ruby: ERROR: Failed to build gem native extension. /usr/bin/ruby1.8 extconf.rb checking for sqlite3.h... yes checking for sqlite3_libversion_number() in -lsqlite3... yes checking for rb_proc_arity()... no checking for sqlite3_initialize()... no sqlite3-ruby only supports sqlite3 versions 3.6.16+, please upgrade! * extconf.rb failed * Could not create Makefile due to some reason, probably lack of necessary libraries and/or headers. Check the mkmf.log file for more details. You may need configuration options. Steps To follow Next I ran across this page; http://groups.google.com/group/sqlite3-ruby/brows