diff options
Diffstat (limited to 'app/controllers/intruders_controller.rb')
-rw-r--r-- | app/controllers/intruders_controller.rb | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/app/controllers/intruders_controller.rb b/app/controllers/intruders_controller.rb new file mode 100644 index 0000000..eb34f2b --- /dev/null +++ b/app/controllers/intruders_controller.rb @@ -0,0 +1,41 @@ +class IntrudersController < ApplicationController + def index + @intruders = Intruder.all + end + + def show + @intruder = Intruder.find(params[:id]) + end + + def new + @intruder = Intruder.new + end + + def create + @intruder = Intruder.new(params[:intruder]) + if @intruder.save + redirect_to @intruder, :notice => t('intruders.controller.successfuly_created') + else + render :new + end + end + + def edit + @intruder = Intruder.find(params[:id]) + end + + def update + @intruder = Intruder.find(params[:id]) + if @intruder.update_attributes(params[:intruder]) + redirect_to @intruder, :notice => t('intruders.controller.successfuly_updated') + else + render :edit + end + end + + def destroy + @intruder = Intruder.find(params[:id]) + @intruder.destroy + redirect_to intruders_url, :notice => t('intruders.controller.successfuly_destroyed') + end +end |