e9_vendors 0.0.9 → 0.0.10
Sign up to get free protection for your applications and to get access to all the features.
data/app/models/vendor.rb
CHANGED
@@ -11,6 +11,7 @@ class Vendor < ActiveRecord::Base
|
|
11
11
|
validates :short_description, :presence => true
|
12
12
|
validates :long_description, :presence => true
|
13
13
|
validates :landing_page, :presence => true
|
14
|
+
validates :vendor_categories, :presence => true
|
14
15
|
|
15
16
|
mount_uploader :logo, LogoUploader
|
16
17
|
|
@@ -9,11 +9,16 @@
|
|
9
9
|
%fieldset.checkbox
|
10
10
|
%legend
|
11
11
|
= f.label :vendor_category_id, resource_class.human_attribute_name(:vendor_category), :class => :req
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
12
|
+
- unless VendorCategory.count.zero?
|
13
|
+
%ul
|
14
|
+
- VendorCategory.order(:name).each do |vc|
|
15
|
+
%li.checkbox
|
16
|
+
= check_box_tag 'vendor[vendor_category_ids][]', vc.id, resource.vendor_category_ids.member?(vc.id), :id => "vendor_category_#{vc.id}"
|
17
|
+
= label_tag "vendor_category_#{vc.id}", vc.name
|
18
|
+
- else
|
19
|
+
No categories exist yet.
|
20
|
+
= link_to("Create one?", new_vendor_category_path)
|
21
|
+
|
17
22
|
.field
|
18
23
|
= upload_mount_field(resource.logo, :reset_path => true, :required => true)
|
19
24
|
|
@@ -39,7 +44,7 @@
|
|
39
44
|
= f.text_area :long_description
|
40
45
|
.field
|
41
46
|
= f.label :landing_page, nil, :class => :req
|
42
|
-
= f.
|
47
|
+
= f.text_field :landing_page
|
43
48
|
|
44
49
|
.actions
|
45
50
|
= f.submit
|
data/lib/e9_vendors/version.rb
CHANGED