diff options
Diffstat (limited to 'app/controllers')
-rw-r--r-- | app/controllers/route_elements_controller.rb | 41 |
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 |