Class: CardTypesController
Instance Method Summary
collapse
#footer_menu, #home_page, #page_title
Instance Method Details
#create ⇒ Object
19
20
21
22
23
24
25
26
27
|
# File 'app/controllers/card_types_controller.rb', line 19
def create
@card_type = CardType.new(params[:card_type])
if @card_type.save
flash[:notice] = 'CardType was successfully created.'
redirect_to :action => 'list'
else
render :action => 'new'
end
end
|
#destroy ⇒ Object
43
44
45
46
|
# File 'app/controllers/card_types_controller.rb', line 43
def destroy
CardType.find(params[:id]).destroy
redirect_to :action => 'list'
end
|
#edit ⇒ Object
29
30
31
|
# File 'app/controllers/card_types_controller.rb', line 29
def edit
@card_type = CardType.find(params[:id])
end
|
#index ⇒ Object
2
3
4
5
|
# File 'app/controllers/card_types_controller.rb', line 2
def index
list
render :action => 'list'
end
|
#list ⇒ Object
7
8
9
|
# File 'app/controllers/card_types_controller.rb', line 7
def list
@card_type_pages, @card_types = paginate :card_types, :per_page => 10
end
|
#new ⇒ Object
15
16
17
|
# File 'app/controllers/card_types_controller.rb', line 15
def new
@card_type = CardType.new
end
|
#show ⇒ Object
11
12
13
|
# File 'app/controllers/card_types_controller.rb', line 11
def show
@card_type = CardType.find(params[:id])
end
|
#update ⇒ Object
33
34
35
36
37
38
39
40
41
|
# File 'app/controllers/card_types_controller.rb', line 33
def update
@card_type = CardType.find(params[:id])
if @card_type.update_attributes(params[:card_type])
flash[:notice] = 'CardType was successfully updated.'
redirect_to :action => 'show', :id => @card_type
else
render :action => 'edit'
end
end
|