Isaac Sloan - Web Developer, Photographer, Musician and Citizen of Earth
Banner700

Saving dynamic serialized fields with fields_for in Rails

February 23, 2015

Tell you model to serialize it as a struct and create a setter to build the struct on create.

# post.rb model
serialize :content, OpenStruct
def content=(v)
  self[:content] = OpenStruct.new(v)
end

Then you can add any form elements you want for content.

-#form partial

= f.fields_for :content, @post.content do |ff|
  .field
    = ff.label :name
    = ff.text_field :name
  .field
Saving dynamic serialized fields with fields_for in Rails

Petergate Authorizations

January 18, 2015

"If you like the straight forward and effective nature of Strong Parameters and suspect that cancan might be overkill for your project then you'll love Petergate's easy to use and read action and content based authorizations."

-- I proclaim optimistically

Installation

Petergate Authorizations

My vimrc

November 12, 2012

" " ========================================================================
" " Isaac Sloan - Vim Configuration 2012
" " ========================================================================
set rtp+=~/.vim/bundle/vundle/
call vundle#rc()
Bundle 'gmarik/vundle'

" My bundles
Bundle 'ervandew/supertab'
Bundle 'tpope/vim-fugitive'
Bundle 'tpope/vim-rails'
Bundle 'tpope/vim-haml'
Bundle 'slim-template/vim-slim'
My vimrc

Setting up Rails, Passenger, Nginx, Mysql and xdelta3 on RED HAT ENTERPRISE LINUX

October 29, 2014

Step 1: Install Redhat RHEL

Step 2: Add a deploy user

adduser deploy

Step 3: Update and Install dependencies

Make sure that each line completes before running the next. Don't just copy the lines in all at once or it will use the beginning letters of one line as an answer to questions the first may ask.

sudo su - root
yum groupinstall "Development Tools" "Development Libraries"
Setting up Rails, Passenger, Nginx, Mysql and xdelta3 on RED HAT ENTERPRISE LINUX

Everything a Web Designer needs to know about Git!

September 05, 2013

Step 1: Delete your Git GUI!

Don't use Tower because somehow you'll manage to break everything in magical ways that make no sense to me.

Step 2: Assume things!

Well I'm going to assume some things. If these things aren't true, assuming they are won't actually help on your part.

  • You're using a real operating system like OSX or Linux
  • Git is already installed on your system
Everything a Web Designer needs to know about Git!