Created
December 5, 2008 18:14
-
-
Save BDQ/32434 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Uncomment this if you reference any of your controllers in activate | |
# require_dependency 'application' | |
module CameraFields | |
def add_camera_fields | |
@additional_product_fields += [ | |
{:name => 'Cline Price'}, | |
{:name => 'Cost'}, | |
{:name => 'Manufacturers SKU'}, | |
{:name => 'Code'} | |
] | |
end | |
end | |
class CameraExtension < Spree::Extension | |
version "1.0" | |
description "Describe your extension here" | |
url "http://yourwebsite.com/camera" | |
def activate | |
Admin::ProductsController.class_eval do | |
include CameraFields | |
before_filter :add_camera_fields | |
end | |
Admin::VariantsController.class_eval do | |
include CameraFields | |
before_filter :add_camera_fields | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment