HOW TO IMPLEMENT ACTS AS STATE MACHINE (AASM)

# DO IT INTO YOUR MODEL # INCLUDE include AASM # DECLARE ATTRIBUTE TO USE aasm.attribute_name :status # DECLARE WORKFLOW OF AASM aasm do state :[state_name], :initial => true state :[state_name], :initial => true, :before_enter => :[do_something] end  

RoR tricks

# HOW TO RUN A RAILS CONSOLE bundle exec rails c # HOW TO DISPLAY MODEL NAMES ActiveRecord::Base.connection.tables # HOW TO DISPLAY MODEL COLUMN NAMES [model_name].column_names # HOW TO DISPLAY ALL MODEL & MODEL COLUMN NAMES ActiveRecord::Base.connection.tables.each do |table_name| puts « \n » + table_name ActiveRecord::Base.connection.columns(table_name).each { |c| puts « –  » + c.name + « :  » +…

RVM Installation

# HOW TO SEE THE CURRENT RUBY VERSION ruby -v # HOW TO INSTALL RVM STABLE VERSION \curl -sSL https://get.rvm.io | bash -s stable –ruby source ~/.rvm/scripts/rvm # HOW TO INSTALL REQUIRE ELEMENTS rvm requirements # HOW TO LIST VERSION KNOWN rvm list known # HOW TO INSTALL RUBY rvm install ruby # HOW TO…