5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
# File 'app/controllers/cambium/admin/settings_controller.rb', line 5
def index
expected_keys = admin_view.form.edit.fields.to_h.stringify_keys.keys
current_keys = Cambium::Setting.keys
(expected_keys - current_keys).each do |key|
Cambium::Setting.create(:key => key)
end
@collection = admin_model.alpha
= @collection.collect(&:key) - expected_keys
if .size > 0
Cambium::Setting.where(:key => ).destroy_all
@collection = admin_model.alpha
end
respond_to do |format|
format.html
format.csv { send_data admin.to_csv(@collection) }
end
end
|