summaryrefslogtreecommitdiff
path: root/app/controllers/route_elements_controller.rb
diff options
context:
space:
mode:
authorStefan Wintermeyer <stefan.wintermeyer@amooma.de>2013-01-16 16:02:25 +0100
committerStefan Wintermeyer <stefan.wintermeyer@amooma.de>2013-01-16 16:02:25 +0100
commit225a812d5f2da7dc205c021a571ff3c6d5307f20 (patch)
treef79d158a4accd539a92a74c3cb6fc729a48d9e80 /app/controllers/route_elements_controller.rb
parent27921c7d5515169270b1739a70f10ad1bf4f4cd7 (diff)
parent0bf4d1350f5d2a07db874977674e5ae0ff0d4256 (diff)
Merge branch 'develop' of github.com:amooma/GS5 into develop
Diffstat (limited to 'app/controllers/route_elements_controller.rb')
-rw-r--r--app/controllers/route_elements_controller.rb41
1 files changed, 41 insertions, 0 deletions
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