summaryrefslogtreecommitdiff
path: root/app/controllers/sim_card_providers_controller.rb
diff options
context:
space:
mode:
authorStefan Wintermeyer <stefan.wintermeyer@amooma.de>2013-02-16 11:10:02 +0100
committerStefan Wintermeyer <stefan.wintermeyer@amooma.de>2013-02-16 11:10:02 +0100
commit5d8ce5f4775ac8bc5f523964e6e36f63ff3c4683 (patch)
tree49ed889b1d10cda98c475f3453abff1b97afb4e7 /app/controllers/sim_card_providers_controller.rb
parentc9066760fd1f5f2f892ce2be5cf2a83bb5210246 (diff)
parent55784bcffc0678ce6102c0b81447434a8030ebd2 (diff)
Merge branch 'develop'5.1-beta5
Diffstat (limited to 'app/controllers/sim_card_providers_controller.rb')
-rw-r--r--app/controllers/sim_card_providers_controller.rb47
1 files changed, 47 insertions, 0 deletions
diff --git a/app/controllers/sim_card_providers_controller.rb b/app/controllers/sim_card_providers_controller.rb
new file mode 100644
index 0000000..e9a019c
--- /dev/null
+++ b/app/controllers/sim_card_providers_controller.rb
@@ -0,0 +1,47 @@
+class SimCardProvidersController < ApplicationController
+ load_and_authorize_resource :sim_card_provider
+ before_filter :spread_breadcrumbs
+
+ def index
+ end
+
+ def show
+ end
+
+ def new
+ end
+
+ def create
+ if @sim_card_provider.save
+ redirect_to @sim_card_provider, :notice => t('sim_card_providers.controller.successfuly_created')
+ else
+ render :new
+ end
+ end
+
+ def edit
+ end
+
+ def update
+ if @sim_card_provider.update_attributes(params[:sim_card_provider])
+ redirect_to @sim_card_provider, :notice => t('sim_card_providers.controller.successfuly_updated')
+ else
+ render :edit
+ end
+ end
+
+ def destroy
+ @sim_card_provider.destroy
+ redirect_to sim_card_providers_url, :notice => t('sim_card_providers.controller.successfuly_destroyed')
+ end
+
+ private
+
+ def spread_breadcrumbs
+ add_breadcrumb t("sim_card_providers.index.page_title"), sim_card_providers_path
+ if @sim_card_provider && !@sim_card_provider.new_record?
+ add_breadcrumb @sim_card_provider, sim_card_provider_path(@sim_card_provider)
+ end
+ end
+
+end