You're taking your first steps into Ruby
A good introduction to programming in general. Easy on newer programmers.
HTTP status code symbols for Rails | |
Thanks to Cody Fauser for this list of HTTP responce codes and their Ruby on Rails symbol mappings. | |
Status Code Symbol | |
1xx Informational | |
100 :continue | |
101 :switching_protocols | |
102 :processing |
export PATH="$PATH:/Applications/Visual Studio Code.app/Contents/Resources/app/bin" | |
export PATH="/usr/local/opt/python/bin:$PATH" | |
export GPG_TTY=$(tty) | |
# export START="$HOME/a" | |
# if [[ $PWD == $HOME ]]; then | |
# cd $START | |
# fi | |
# alias ls='ls -F --color --show-control-chars' |
You're taking your first steps into Ruby
A good introduction to programming in general. Easy on newer programmers.
class PostController < ApplicationController | |
before_action :set_post | |
before_action :set_active_posts, only: [:create, :update] | |
def show | |
@post = @posts.find_by(slug: params[:slug]) | |
@author = @post.author | |
if !@post.present? | |
render "errors/404.html", status: :not_found |
class Admin::AdminPostsController < InheritedResources::Base | |
layout 'admin' | |
before_filter :require_login | |
before_action :set_post | |
before_action :set_branches | |
before_action :set_sections | |
load_and_authorize_resource | |
def index |