summaryrefslogtreecommitdiff
path: root/app/controllers
diff options
context:
space:
mode:
authorspag <spag@golwen.net>2013-01-16 16:11:21 +0100
committerspag <spag@golwen.net>2013-01-16 16:11:21 +0100
commit1940b08d47350f8cbf84ad1c13170c7c7505b5aa (patch)
tree18850d2a588cca1cc76e385122c65c24630169c0 /app/controllers
parentdc68dbecc380e94322aa2777fcbb5be1f4b0af99 (diff)
parent225a812d5f2da7dc205c021a571ff3c6d5307f20 (diff)
Merge branch 'develop' of github.com:amooma/GS5 into develop
Conflicts: misc/freeswitch/scripts/dialplan/router.lua
Diffstat (limited to 'app/controllers')
-rw-r--r--app/controllers/call_routes_controller.rb41
-rw-r--r--app/controllers/route_elements_controller.rb41
-rw-r--r--app/controllers/users_controller.rb2
3 files changed, 83 insertions, 1 deletions
diff --git a/app/controllers/call_routes_controller.rb b/app/controllers/call_routes_controller.rb
new file mode 100644
index 0000000..631339b
--- /dev/null
+++ b/app/controllers/call_routes_controller.rb
@@ -0,0 +1,41 @@
+class CallRoutesController < ApplicationController
+ def index
+ @call_routes = CallRoute.all
+ end
+
+ def show
+ @call_route = CallRoute.find(params[:id])
+ end
+
+ def new
+ @call_route = CallRoute.new
+ end
+
+ def create
+ @call_route = CallRoute.new(params[:call_route])
+ if @call_route.save
+ redirect_to @call_route, :notice => t('call_routes.controller.successfuly_created')
+ else
+ render :new
+ end
+ end
+
+ def edit
+ @call_route = CallRoute.find(params[:id])
+ end
+
+ def update
+ @call_route = CallRoute.find(params[:id])
+ if @call_route.update_attributes(params[:call_route])
+ redirect_to @call_route, :notice => t('call_routes.controller.successfuly_updated')
+ else
+ render :edit
+ end
+ end
+
+ def destroy
+ @call_route = CallRoute.find(params[:id])
+ @call_route.destroy
+ redirect_to call_routes_url, :notice => t('call_routes.controller.successfuly_destroyed')
+ end
+end
diff --git a/app/controllers/route_elements_controller.rb b/app/controllers/route_elements_controller.rb
new file mode 100644
index 0000000..595a20d
--- /dev/null
+++ b/app/controllers/route_elements_controller.rb
@@ -0,0 +1,41 @@
+class RouteElementsController < ApplicationController
+ def index
+ @route_elements = RouteElement.all
+ end
+
+ def show
+ @route_element = RouteElement.find(params[:id])
+ end
+
+ def new
+ @route_element = RouteElement.new
+ end
+
+ def create
+ @route_element = RouteElement.new(params[:route_element])
+ if @route_element.save
+ redirect_to @route_element, :notice => t('route_elements.controller.successfuly_created')
+ else
+ render :new
+ end
+ end
+
+ def edit
+ @route_element = RouteElement.find(params[:id])
+ end
+
+ def update
+ @route_element = RouteElement.find(params[:id])
+ if @route_element.update_attributes(params[:route_element])
+ redirect_to @route_element, :notice => t('route_elements.controller.successfuly_updated')
+ else
+ render :edit
+ end
+ end
+
+ def destroy
+ @route_element = RouteElement.find(params[:id])
+ @route_element.destroy
+ redirect_to route_elements_url, :notice => t('route_elements.controller.successfuly_destroyed')
+ end
+end
diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb
index 454c26b..7af8e68 100644
--- a/app/controllers/users_controller.rb
+++ b/app/controllers/users_controller.rb
@@ -10,7 +10,7 @@ class UsersController < ApplicationController
end
def show
- @phone_books = PhoneBook.accessible_by( Ability.new( @user ) ).all
+ @phone_books = PhoneBook.accessible_by( Ability.new( @user ), :read )
end
def new