Admin
Jul 11, 2020
22 comments
293
Suppose you want to remove a 'comments' table from a blog application. You can do so by performing the following tasks from the command line (e.g., Terminal). Step one: $ rails console Step two: $ ActiveRecord::Migration.drop_table(:c...
Snippet
Delete table
Admin
May 19, 2016
17 comments
985
Answer 1 In Ruby, nil in an object (a single instance of the class NilClass) so methods can be called on it. nil? is a standard method in Ruby that can be called on all objects and returns true for the nil object and false for anything else. emp...
Snippet
Difference between .nil?, .blank? and .empty in Ruby?
The map method takes an enumerable object and a block, and runs the block for each element, outputting each returned value from the block (the original object is unchanged unless you use map!): [1, 2, 3].map { |n| n * n } #=> [1, 4, 9] Array ...
Snippet
What does the "map" method do in Ruby? How is it dif...
Admin
Apr 04, 2016
23 comments
344
Download Ruby and install Check ruby installation: ruby -e "puts 1+1" -> 2 irb - for interactive ruby commands Download devkit for corresponding ruby version and extract to c:\devkit Browse to c:\devkit and run this: ruby dk.rb init type...
Snippet
Installing Ruby on Windows
Admin
Apr 01, 2016
15 comments
1.09K
Development Install Ruby Install DevKit (http://rubyinstaller.org/downloads/) gem install capistrano --no-ri --no-rdoc Deployment Machine Update the software sources list And upgrade the dated applications: aptitude update aptitud...
Snippet
Capistrano - Installation and configuration