mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-14 23:47:48 +00:00
Adding addresses to existing groups and make them changable
This commit is contained in:
@@ -12,6 +12,7 @@ class EnterpriseGroup < ActiveRecord::Base
|
||||
|
||||
attr_accessible :name, :description, :long_description, :on_front_page, :enterprise_ids
|
||||
attr_accessible :logo, :promo_image
|
||||
attr_accessible :address_attributes
|
||||
attr_accessible :email, :website, :facebook, :instagram, :linkedin, :twitter
|
||||
|
||||
delegate :phone, :to => :address
|
||||
@@ -37,7 +38,7 @@ class EnterpriseGroup < ActiveRecord::Base
|
||||
scope :on_front_page, where(on_front_page: true)
|
||||
|
||||
def set_unused_address_fields
|
||||
address.firstname = address.lastname = address.phone = 'unused' if address.present?
|
||||
address.firstname = address.lastname = 'unused' if address.present?
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@@ -52,9 +52,10 @@
|
||||
%legend Contact
|
||||
.row
|
||||
.alpha.three.columns
|
||||
= f.label :phone
|
||||
= af.label :phone
|
||||
%span.required *
|
||||
.omega.eight.columns
|
||||
= f.text_field :phone, { placeholder: "eg. 98 7654 3210"}
|
||||
= af.text_field :phone, { placeholder: "eg. 98 7654 3210"}
|
||||
.row
|
||||
.three.columns.alpha
|
||||
= af.label :address1
|
||||
|
||||
Reference in New Issue
Block a user