Skip to content

Instantly share code, notes, and snippets.

View denniskeefe's full-sized avatar

Dennis Keefe denniskeefe

View GitHub Profile
@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 %>
@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
class Notes < ActiveRecord::Migration
def up
end
def down
end
end
@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
@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 / 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 / log file
Created February 6, 2013 04:46
Heroku log
22:45][myapp(master)][v. ruby-1.9.3-p194]$ heroku logs
2013-02-05T20:30:24+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.11/lib/rails/commands.rb:50:in `tap'
2013-02-05T20:30:24+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.11/lib/rails/commands.rb:50:in `<top (required)>'
2013-02-05T20:30:24+00:00 app[web.1]: from script/rails:6:in `require'
2013-02-05T20:30:24+00:00 app[web.1]: from script/rails:6:in `<main>'
2013-02-05T20:30:24+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.4.4/lib/rack/builder.rb:40:in `eval'
2013-02-05T20:30:24+00:00 app[web.1]: from /app/config.ru:in `<main>'
2013-02-05T20:30:24+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.11/lib/rails/commands.rb:55:in `block in <top (required)>'
2013-02-05T20:30:24+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.11/lib/rails/commands/server.rb:46:in `app'
2013-02-05T20:30:24+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1
@denniskeefe
denniskeefe / gist:4950641
Created February 14, 2013 04:42
NewsStoryFinder gemfile
source :rubygems
def darwin_only(require_as)
RUBY_PLATFORM.include?('darwin') && require_as
end
def linux_only(require_as)
RUBY_PLATFORM.include?('linux') && require_as
end
source 'https://rubygems.org'
gem 'rails', '3.2.12'
group :development do
gem 'sqlite3'
end
group :production do
@denniskeefe
denniskeefe / gist:5428553
Created April 21, 2013 05:06
index.html.haml
<h1>Welcome aspiring rubyists!</h1>
<p>I created this site as a resource for those who want to give ruby/rails a try and just don't really know where to start. There are so many resources out there, it can be a bit overwhelming. I decided to put together a site with some of the most popular resources in hopes of helping people get off to a great start!</p>
<p>If you are new to programming and want to see if ruby is something you might like, I recommend checking out some of the free interactive resources in the sidebar. These are great starters and will give you an general understanding of how ruby works.
</p>
<p>Once you get a feel for things and decide that you want to move forward, use one of the simple installation tools at the top of the page. Setting up ruby/rails manually can be difficult, especially on a Windows machine, these tools will get you up and running fast.
</p>