Open terminal and type:
1. Create a directory at ~/bin:
mkdir ~/bin
2. Copy sublime executable to your ~/bin directory:
| # app/models/concerns/multiparameter_attribute_assignment.rb | |
| module MultiparameterAttributeAssignment | |
| include ActiveModel::ForbiddenAttributesProtection | |
| def initialize(params = {}) | |
| assign_attributes(params) | |
| end | |
| def assign_attributes(new_attributes) |
| namespace :db do | |
| desc "Clear all tables" | |
| task :clear => :environment do | |
| conn = ActiveRecord::Base.connection | |
| conn.tables.select{|t| t.start_with? ActiveRecord::Base.table_name_prefix }.each do |t| | |
| conn.drop_table t | |
| end | |
| end | |
| desc "Dump database into an SQL file" |
| #!/usr/bin/env ruby | |
| # A quick and dirty implementation of an HTTP proxy server in Ruby | |
| # because I did not want to install anything. | |
| # | |
| # Copyright (C) 2009-2014 Torsten Becker <torsten.becker@gmail.com> | |
| # | |
| # Permission is hereby granted, free of charge, to any person obtaining | |
| # a copy of this software and associated documentation files (the | |
| # "Software"), to deal in the Software without restriction, including | |
| # without limitation the rights to use, copy, modify, merge, publish, |
| !!! 5 | |
| html(class='no-js') | |
| head | |
| meta(charset='utf-8') | |
| meta(http-equiv='X-UA-Compatible', content='IE=edge') | |
| title | |
| meta(name='description', content='') | |
| meta(name='viewport', content='width=device-width, initial-scale=1') |
| - Check rails version | |
| $ rails -v | |
| - To update rails | |
| $ gem update rails | |
| - Creating a new rails app using postgresql | |
| $ mkdir rails_projects | |
| $ cd rails_projects | |
| $ rails new myapp --database=postgresql |