diff --git a/app/controllers/application.rb b/app/controllers/application.rb index f7ad76e..a42f0af 100644 --- a/app/controllers/application.rb +++ b/app/controllers/application.rb @@ -17,4 +17,11 @@ class ApplicationController < ActionController::Base end end + def self.acts_as_admin_controller + before_filter :load_admin_controller + end + def load_admin_controller + # TODO: check access control + end + end diff --git a/app/controllers/features_controller.rb b/app/controllers/features_controller.rb new file mode 100644 index 0000000..06c0eef --- /dev/null +++ b/app/controllers/features_controller.rb @@ -0,0 +1,7 @@ +class FeaturesController < ApplicationController + acts_as_admin_controller + + def index + @features = VirtualCommunity::EXISTING_FEATURES + end +end diff --git a/app/helpers/features_helper.rb b/app/helpers/features_helper.rb new file mode 100644 index 0000000..1a5e6b2 --- /dev/null +++ b/app/helpers/features_helper.rb @@ -0,0 +1,2 @@ +module FeaturesHelper +end diff --git a/app/models/virtual_community.rb b/app/models/virtual_community.rb index 5f15bd1..5f53239 100644 --- a/app/models/virtual_community.rb +++ b/app/models/virtual_community.rb @@ -2,9 +2,9 @@ class VirtualCommunity < ActiveRecord::Base # TODO: these are test features EXISTING_FEATURES = { - 'feature1' => _('Feature 1'), - 'feature2' => _('Feature 2'), - 'feature3' => _('Feature 3'), + 'feature1' => _('Enable Feature 1'), + 'feature2' => _('Enable Feature 2'), + 'feature3' => _('Enable Feature 3'), } # ################################################# diff --git a/app/views/features/index.rhtml b/app/views/features/index.rhtml new file mode 100644 index 0000000..4fff680 --- /dev/null +++ b/app/views/features/index.rhtml @@ -0,0 +1,13 @@ +
<%= text %> | +<%= check_box_tag "feature[#{feature}]" %> | +
<%= submit_tag %> |