Skip to content

Instantly share code, notes, and snippets.

View deJaVisions's full-sized avatar

deJaVisions deJaVisions

View GitHub Profile
@deJaVisions
deJaVisions / agile web dev view
Created September 26, 2011 21:49
index.html.erb
<h1>LIsting products</h1>
<table>
<% @products.each do |product| %>
<tr class="<%= cycle('list_line_odd'g, 'list_line_even') %>">
<td>
<%= image_tag(product.image_url, class: 'list_image') %>
</td>
<td class="list_description">
(in /home/vagrant/Sites/agile)
** Invoke db:migrate (first_time)
** Invoke environment (first_time)
** Execute environment
** Invoke db:load_config (first_time)
** Invoke rails_env (first_time)
** Execute rails_env
** Execute db:load_config
** Execute db:migrate
== UpdateLineItemsWithPrice: migrating =======================================
class UpdateLineItemsWithPrice < ActiveRecord::Migration
def up
LineItem.all.each do |item|
item.price = item.product.price
item.save
end
end
def down
end
@deJaVisions
deJaVisions / gist:1274622
Created October 10, 2011 04:16
spree edge create sandbox/spree extension (new) errors
phong:~/Sites/spree[master]$ bundle exec rake sandbox
/Users/phong/.rvm/gems/ruby-1.9.2-p290@dreamcatcher/gems/rack-1.3.4/lib/rack/backports/uri/common_192.rb:53: warning: already initialized constant WFKV_
create
create README
create Rakefile
create config.ru
create .gitignore
create Gemfile
create app
create app/assets/images/rails.png
= get_recently_viewed_products()
-if @promoted_items.empty?
there are currently no promoted items
-else
- @promoted_items.map do |promo|
%hr
- product = Product.find_by_id(promo.product_id)
%div{align: :left}
= link_to(product.name, url_for(product))
- if product.images.size > 1
phong:~/Sites/spree/spree_flag_promotions[promoted_items_admin]$ git push -u origin promoted_items_admin
Counting objects: 13, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (7/7), done.
Writing objects: 100% (7/7), 573 bytes, done.
Total 7 (delta 4), reused 0 (delta 0)
To git@github.com:doktorj/spree-promoted-items.git
2ded57c..2815c4b promoted_items_admin -> promoted_items_admin
Branch promoted_items_admin set up to track remote branch promoted_items_admin from origin.
ActiveRecord::RecordNotFound in Admin::PromotedItemsController#toggle
Couldn't find PromotedItem with id=248786582
Rails.root: /Users/phong/Sites/spree_test
Application Trace | Framework Trace | Full Trace
Request
Parameters:
/Users/phong/.rvm/gems/ruby-1.9.2-p290@dreamcatcher/gems/railties-3.1.1/lib/rails.rb:46:in `configuration': undefined method `config' for nil:NilClass (NoMethodError)
from /Users/phong/Sites/spree_test/spree_flagged_promotions/lib/spree_flagged_promotions.rb:5:in `block in <top (required)>'
from /Users/phong/Sites/spree_test/spree_flagged_promotions/lib/spree_flagged_promotions.rb:4:in `glob'
from /Users/phong/Sites/spree_test/spree_flagged_promotions/lib/spree_flagged_promotions.rb:4:in `<top (required)>'
from /Users/phong/.rvm/gems/ruby-1.9.2-p290@dreamcatcher/gems/bundler-1.0.18/lib/bundler/runtime.rb:68:in `require'
from /Users/phong/.rvm/gems/ruby-1.9.2-p290@dreamcatcher/gems/bundler-1.0.18/lib/bundler/runtime.rb:68:in `block (2 levels) in require'
from /Users/phong/.rvm/gems/ruby-1.9.2-p290@dreamcatcher/gems/bundler-1.0.18/lib/bundler/runtime.rb:66:in `each'
from /Users/phong/.rvm/gems/ruby-1.9.2-p290@dreamcatcher/gems/bundler-1.0.18/lib/bundler/runtime.rb:66:in `block in require'
from /Users/ph
%form_tag
%fieldset
- 20.times do |index|
text_name = "psa#{index}_text"
date_name = "psa#{index}_date"
%label{:for => 'psa1'}
%input{:type => "text1", :name => text_name, :id => text_name}
%label{:for => "date1"} DATE 1
%input{:type => "text", :name => date_name, :id => date_name}
%br
phong:~/Sites/twolips[spree-install]$ cp -R ../twolips_orig/ .
cp: ./.git/objects/pack/pack-88d8cd10f624611c6f28a76b84cb45b84d26737c.idx: Permission denied
cp: ./.git/objects/pack/pack-88d8cd10f624611c6f28a76b84cb45b84d26737c.pack: Permission denied
phong:~/Sites/twolips[master]