summaryrefslogtreecommitdiff
path: root/app/controllers/route_elements_controller.rb
diff options
context:
space:
mode:
authorPeter Kozak <spag@golwen.net>2013-01-16 08:37:56 -0500
committerPeter Kozak <spag@golwen.net>2013-01-16 08:37:56 -0500
commit8c83a89c6fbfdb31cae8ea6fcf2fd50c12c076a5 (patch)
tree351d88cdc12b1de9511ac33b63673b8f904622c3 /app/controllers/route_elements_controller.rb
parent113e3c6c6117fbeca7b9bf1f0e6dc26b0db9c407 (diff)
route_elements added
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