add selector for distributor in checkout. Not saving relation as yet.

This commit is contained in:
Andrew Spinks
2012-04-07 16:34:27 +10:00
parent 3f1ed0ca06
commit b2b8bd0112
5 changed files with 12 additions and 3 deletions

View File

@@ -15,6 +15,7 @@ gem 'simple_form'
gem 'unicorn'
# gem 'spree_heroku'
gem 'haml'
# Gems used only for assets and not required

View File

@@ -89,6 +89,7 @@ GEM
ffi (1.0.11)
gyoku (0.4.4)
builder (>= 2.1.2)
haml (3.1.4)
highline (1.6.8)
hike (1.2.1)
httpi (0.9.6)
@@ -273,6 +274,7 @@ PLATFORMS
DEPENDENCIES
capybara
coffee-rails (~> 3.1.1)
haml
jquery-rails
machinist
pg

View File

@@ -1,5 +1,7 @@
module Spree
class Distributor < ActiveRecord::Base
set_table_name 'distributors'
validates :name, :pickup_address, :presence => true
end
end

View File

@@ -1,4 +1,4 @@
Deface::Override.new(:virtual_path => "spree/checkout/_delivery",
:insert_before => "[data-hook='buttons']",
:text => "<p>TODO: Select a drop off point.... </p>",
Deface::Override.new(:virtual_path => "spree/checkout/_address",
:replace => "[data-hook='shipping_fieldset_wrapper']",
:partial => "spree/checkout/distributor",
:name => "drop_off_point")

View File

@@ -0,0 +1,4 @@
.columns.omega.six
%fieldset{:id => 'shipping'}
%legend Collection Point
=select("distributor", "distributor_id", Spree::Distributor.all.collect {|p| [ p.name , p.id] },)