###Step 1: Install XCode
Check if the full Xcode package is already installed:
$ xcode-select -p
If you see:
/Applications/Xcode.app/Contents/Developer
class PostsController < ApplicationController | |
# GET /posts | |
# GET /posts.json | |
before_filter :authenticate_user!, only: [:new, :create, :edit, :destroy] | |
def index | |
if params[:options_for_active] == 'Show All' | |
@posts = Post.recent | |
.search_title_body(params[:search_by_title]) |
class Post < ActiveRecord::Base | |
attr_accessible :text, :title, :user_id, :category_id | |
validates :title, presence: true | |
validates :category_id, presence: true | |
validates_length_of :title, maximum:15 | |
validates :text, presence:true | |
belongs_to :user | |
has_many :comments, :dependent => :destroy, foreign_key: :post_id | |
belongs_to :category |
" PLUGINS | |
" vim-rails | |
" grep.vim | |
" nerdcommenter | |
" nerdtree | |
" snipmate.vim | |
" vim-fugitive | |
" vim-fuzzyfinder-pathogen | |
" vim-ragtag | |
" vim-surround |
var toast=function(msg){ | |
$("<div class='ui-loader ui-overlay-shadow ui-body-e ui-corner-all'><h3>"+msg+"</h3></div>") | |
.css({ display: "block", | |
opacity: 0.90, | |
position: "fixed", | |
padding: "7px", | |
"text-align": "center", | |
width: "270px", | |
left: ($(window).width() - 284)/2, | |
top: $(window).height()/2 }) |
"" | |
"" Janus setup | |
"" | |
" Define paths | |
let g:janus_path = escape(fnamemodify(resolve(expand("<sfile>:p")), ":h"), ' ') | |
let g:janus_vim_path = escape(fnamemodify(resolve(expand("<sfile>:p" . "vim")), ":h"), ' ') | |
let g:janus_custom_path = expand("~/.janus") | |
" Source janus's core |
# SSL self signed localhost for rails start to finish, no red warnings. | |
# 1) Create your private key (any password will do, we remove it below) | |
$ openssl genrsa -des3 -out server.orig.key 2048 | |
# 2) Remove the password | |
$ openssl rsa -in server.orig.key -out server.key |
###Step 1: Install XCode
Check if the full Xcode package is already installed:
$ xcode-select -p
If you see:
/Applications/Xcode.app/Contents/Developer
###Step 1: Install XCode
Check if the full Xcode package is already installed:
$ xcode-select -p
If you see:
/Applications/Xcode.app/Contents/Developer
$ brew uninstall postgresql | |
$ gem uninstall pg # ALL OF THEM | |
$ rm -fr /usr/local/var/postgres | |
$ launchctl unload -w ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist | |
$ pg_ctl -D /usr/local/var/postgres stop -s -m fast # WE SHOULD HAVE ALL postgres SERVERS & PROCESSES STOPPED BY NOW | |
$ brew install postgres | |
$ env ARCHFLAGS="-arch x86_64" gem install pg | |
$ echo "DONE." >> /dev/null | |
# make directory for new rails app | |
mkdir app | |
cd app | |
# specify ruby version | |
echo 2.6.3 > .ruby-version | |
echo "source 'https://rubygems.org'" > Gemfile | |
echo "gem 'rails', '~> 6.1.0.alpha', git: 'https://github.com/Shopify/rails'" >> Gemfile | |
OR gem 'rails', '~> 6.1.0.alpha', git: 'https://github.com/Shopify/rails' |