diff options
Diffstat (limited to 'app/controllers/call_routes_controller.rb')
-rw-r--r-- | app/controllers/call_routes_controller.rb | 41 |
1 files changed, 41 insertions, 0 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 |