Skip to content

Instantly share code, notes, and snippets.

View esparkman's full-sized avatar

Evan Sparkman esparkman

View GitHub Profile
esdezines ~: rvm install 1.9.2
info: Installing Ruby from source to: /Users/esparkman/.rvm/rubies/ruby-1.9.2-preview3
info: /Users/esparkman/.rvm/src/ruby-1.9.2-preview3 has already been extracted.
info: Configuring ruby-1.9.2-preview3, this may take a while depending on your cpu(s)...
error: Error running './configure --prefix=/Users/esparkman/.rvm/rubies/ruby-1.9.2-preview3 --enable-shared ', please check /Users/esparkman/.rvm/log/ruby-1.9.2-preview3/configure*.log
[2010-06-27 15:19:12] ./configure --prefix=/Users/esparkman/.rvm/rubies/ruby-1.9.2-preview3 --enable-shared
configure: error: cannot find install-sh, install.sh, or shtool in tool "."/tool
source 'http://rubygems.org'
gem 'rails', '3.0.0.beta4'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
gem 'sqlite3-ruby', :require => 'sqlite3'
gem 'devise', :git => "http://github.com/plataformatec/devise.git"
class User < ActiveRecord::Base
has_one :profile, :dependent => :destroy
# Include default devise modules. Others available are:
# :http_authenticatable, :token_authenticatable, :confirmable, :lockable, :timeoutable and :activatable
devise :registerable, :database_authenticatable, :recoverable,
:rememberable, :trackable, :validatable
# Setup accessible (or protected) attributes for your model
source :gemcutter
gem "rails", "~> 2.3.8"
gem "sqlite3-ruby", :require => "sqlite3"
# bundler requires these gems in all environments
# gem "nokogiri", "1.4.2"
# gem "geokit"
gem 'devise'
gem 'cancan'
gem 'linode'
def csv_import
@directory = Directory.all
@parsed_file=CSV::Reader.parse(params[:dump][:file])
n=0
@parsed_file.each do |row|
d=Directory.new
d.listing=row[0]
d.department=row[1]
d.old_phone=row[2]
d.new_phone=row[3]
<h1>Node Information</h1>
<% @user.nodes.each do |node| %>
<p>
<b>Unique Name:</b>
<%= link_to node.name, user_nodes_path(@user, node) %>
</p>
<p>
<b>API KEY</b>
<%= node.api_key %>
<% for photo in @project.photos %>
<p><%= image_tag(photo.data(:thumb)) %></p><%= check_box :photo_remove, :destroy %>
<% end %>
class Photo < ActiveRecord::Base
belongs_to :project, :dependent => :destroy
has_attached_file :data, :styles => { :medium => "300x300>", :thumb => "100x100>" }
validates_attachment_content_type :data, :content_type => 'image/jpeg', :message => "has to be in jpeg format"
end
<% @project.photos.each do |photo| %>
<p><%= image_tag(photo.data(:thumb)) %></p><%= link_to 'Delete', photo, :class => 'remote-delete' %>
<% end %>
Gives this => undefined method `photo_path' for #<#<Class:0xa2cd940>:0xa2cc9b4>