blob: eb34f2b9252cf788bf84476168d3aa1e48aab2f0 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
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
|