blob: a70b1f4d32cb29094684f3782cf4d26c44a7be14 (
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 AddressesController < ApplicationController
def index
@addresses = Address.all
end
def show
@address = Address.find(params[:id])
end
def new
@address = Address.new
end
def create
@address = Address.new(params[:address])
if @address.save
redirect_to @address, :notice => t('addresses.controller.successfuly_created')
else
render :new
end
end
def edit
@address = Address.find(params[:id])
end
def update
@address = Address.find(params[:id])
if @address.update_attributes(params[:address])
redirect_to @address, :notice => t('addresses.controller.successfuly_updated')
else
render :edit
end
end
def destroy
@address = Address.find(params[:id])
@address.destroy
redirect_to addresses_url, :notice => t('addresses.controller.successfuly_destroyed')
end
end
|