summaryrefslogtreecommitdiff
path: root/app/controllers
diff options
context:
space:
mode:
Diffstat (limited to 'app/controllers')
-rw-r--r--app/controllers/pager_group_destinations_controller.rb41
-rw-r--r--app/controllers/pager_groups_controller.rb41
2 files changed, 82 insertions, 0 deletions
diff --git a/app/controllers/pager_group_destinations_controller.rb b/app/controllers/pager_group_destinations_controller.rb
new file mode 100644
index 0000000..655054a
--- /dev/null
+++ b/app/controllers/pager_group_destinations_controller.rb
@@ -0,0 +1,41 @@
+class PagerGroupDestinationsController < ApplicationController
+ def index
+ @pager_group_destinations = PagerGroupDestination.all
+ end
+
+ def show
+ @pager_group_destination = PagerGroupDestination.find(params[:id])
+ end
+
+ def new
+ @pager_group_destination = PagerGroupDestination.new
+ end
+
+ def create
+ @pager_group_destination = PagerGroupDestination.new(params[:pager_group_destination])
+ if @pager_group_destination.save
+ redirect_to @pager_group_destination, :notice => t('pager_group_destinations.controller.successfuly_created')
+ else
+ render :new
+ end
+ end
+
+ def edit
+ @pager_group_destination = PagerGroupDestination.find(params[:id])
+ end
+
+ def update
+ @pager_group_destination = PagerGroupDestination.find(params[:id])
+ if @pager_group_destination.update_attributes(params[:pager_group_destination])
+ redirect_to @pager_group_destination, :notice => t('pager_group_destinations.controller.successfuly_updated')
+ else
+ render :edit
+ end
+ end
+
+ def destroy
+ @pager_group_destination = PagerGroupDestination.find(params[:id])
+ @pager_group_destination.destroy
+ redirect_to pager_group_destinations_url, :notice => t('pager_group_destinations.controller.successfuly_destroyed')
+ end
+end
diff --git a/app/controllers/pager_groups_controller.rb b/app/controllers/pager_groups_controller.rb
new file mode 100644
index 0000000..4fa21c2
--- /dev/null
+++ b/app/controllers/pager_groups_controller.rb
@@ -0,0 +1,41 @@
+class PagerGroupsController < ApplicationController
+ def index
+ @pager_groups = PagerGroup.all
+ end
+
+ def show
+ @pager_group = PagerGroup.find(params[:id])
+ end
+
+ def new
+ @pager_group = PagerGroup.new
+ end
+
+ def create
+ @pager_group = PagerGroup.new(params[:pager_group])
+ if @pager_group.save
+ redirect_to @pager_group, :notice => t('pager_groups.controller.successfuly_created')
+ else
+ render :new
+ end
+ end
+
+ def edit
+ @pager_group = PagerGroup.find(params[:id])
+ end
+
+ def update
+ @pager_group = PagerGroup.find(params[:id])
+ if @pager_group.update_attributes(params[:pager_group])
+ redirect_to @pager_group, :notice => t('pager_groups.controller.successfuly_updated')
+ else
+ render :edit
+ end
+ end
+
+ def destroy
+ @pager_group = PagerGroup.find(params[:id])
+ @pager_group.destroy
+ redirect_to pager_groups_url, :notice => t('pager_groups.controller.successfuly_destroyed')
+ end
+end