Class: CardSizesController

Inherits:
ApplicationController show all
Defined in:
app/controllers/card_sizes_controller.rb

Instance Method Summary collapse

Methods included from ApplicationHelper

#footer_menu, #home_page, #page_title

Instance Method Details

#createObject



19
20
21
22
23
24
25
26
27
# File 'app/controllers/card_sizes_controller.rb', line 19

def create
  @card_size = CardSize.new(params[:card_size])
  if @card_size.save
    flash[:notice] = 'CardSize was successfully created.'
    redirect_to :action => 'list'
  else
    render :action => 'new'
  end
end

#destroyObject



43
44
45
46
# File 'app/controllers/card_sizes_controller.rb', line 43

def destroy
  CardSize.find(params[:id]).destroy
  redirect_to :action => 'list'
end

#editObject



29
30
31
# File 'app/controllers/card_sizes_controller.rb', line 29

def edit
  @card_size = CardSize.find(params[:id])
end

#indexObject



2
3
4
5
# File 'app/controllers/card_sizes_controller.rb', line 2

def index
  list
  render :action => 'list'
end

#listObject



7
8
9
# File 'app/controllers/card_sizes_controller.rb', line 7

def list
  @card_size_pages, @card_sizes = paginate :card_sizes, :per_page => 10
end

#newObject



15
16
17
# File 'app/controllers/card_sizes_controller.rb', line 15

def new
  @card_size = CardSize.new
end

#showObject



11
12
13
# File 'app/controllers/card_sizes_controller.rb', line 11

def show
  @card_size = CardSize.find(params[:id])
end

#updateObject



33
34
35
36
37
38
39
40
41
# File 'app/controllers/card_sizes_controller.rb', line 33

def update
  @card_size = CardSize.find(params[:id])
  if @card_size.update_attributes(params[:card_size])
    flash[:notice] = 'CardSize was successfully updated.'
    redirect_to :action => 'show', :id => @card_size
  else
    render :action => 'edit'
  end
end