Skip to content

Instantly share code, notes, and snippets.

@teeparham
Created July 19, 2010 16:00
Show Gist options
  • Save teeparham/481589 to your computer and use it in GitHub Desktop.
Save teeparham/481589 to your computer and use it in GitHub Desktop.
# Samples for formatting additional Product fields in Spree Admin
# SelectField: adds a select box with values 1..20
# WideField: adds a standard text box, but with a specified size
# HugeField: adds a text area with a specified number of columns
Variant.additional_fields += [
{ :name => 'SelectField',
:only => [:product],
:use => 'select',
:value => Proc.new{ (1..20).collect{|i| [i,i]} }
},
{ :name => 'WideField',
:only => [:product],
:options => { :size => '180'}
},
{ :name => 'HugeField',
:only => [:product],
:use => 'text_area',
:options => { :cols => '100'}
}
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment