Skip to content

Instantly share code, notes, and snippets.

View denniskeefe's full-sized avatar

Dennis Keefe denniskeefe

View GitHub Profile
@denniskeefe
denniskeefe / gist:4640465
Created January 26, 2013 05:58
Spree "devise-encryptable" error fix
While working through the setup of the latest release of Spree, I ran into an error concerning "gem devise-encryptable" it seems that you can solve this error by simply moving the "gem devise-encryptable" line to the bottom of the gemfile.
source 'https://rubygems.org'
gem 'rails', '3.2.11'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
gem 'sqlite3'
@denniskeefe
denniskeefe / gist:4146598
Created November 26, 2012 04:19
CustomerShow
<%- model_class = Customer -%>
<div class="page-header">
<h1><%=t '.title', :default => model_class.model_name.human %></h1>
</div>
<dl class="dl-horizontal">
<dt><strong><%= model_class.human_attribute_name(:name_first) %>:</strong></dt>
<dd><%= @customer.name_first %></dd>
<dt><strong><%= model_class.human_attribute_name(:name_last) %>:</strong></dt>
<dd><%= @customer.name_last %></dd>
@denniskeefe
denniskeefe / customer_controller
Created November 26, 2012 04:13
CustomerController
class CustomersController < ApplicationController
before_filter :authenticate_user!
# GET /customers
# GET /customers.json
def create
@customer = Customer.new(params[:customer])
@customer.user_id = current_user.id
if @customer.save
class Notes < ActiveRecord::Migration
def up
end
def down
end
end
@denniskeefe
denniskeefe / gist:4093533
Created November 17, 2012 05:26
create notes
class CreateNotes < ActiveRecord::Migration
def change
create_table :notes do |t|
t.string :title
t.text :comment
t.timestamps
end
end
end
@denniskeefe
denniskeefe / _form
Created November 12, 2012 04:39
CRM-Two Form
<%= form_for @customer, :html => {:multipart => true} do |f| %>
<%= f.hidden_field :id %>
<p>
<%= f.file_field :image %>
</p>
<p><%= f.submit "Upload" %></p>
<% end %>