Class: IformatsController

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

Instance Method Summary collapse

Methods included from Zena::App

included

Instance Method Details

#createObject



26
27
28
# File 'app/controllers/iformats_controller.rb', line 26

def create
  @iformat = Iformat.create(params[:iformat])
end

#destroyObject



45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# File 'app/controllers/iformats_controller.rb', line 45

def destroy
  @iformat.destroy

  respond_to do |format|
    format.html do
      if @iformat.errors.empty?
        redirect_to :action => 'index'
      else
        render :action => 'edit'
      end
    end
    format.js   do
      render(:partial => 'form') unless @iformat.errors.empty?
    end
    format.xml  { head :ok }
  end
end

#editObject



10
11
12
13
14
15
# File 'app/controllers/iformats_controller.rb', line 10

def edit
  respond_to do |format|
    format.html
    format.js { render :partial => 'form' }
  end
end

#indexObject



17
18
19
20
21
22
23
24
# File 'app/controllers/iformats_controller.rb', line 17

def index
  @iformat_pages, @iformats = nil, nil
  @iformats = Iformat.list
  @iformat  = Iformat.new
  respond_to do |format|
    format.html
  end
end

#showObject



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

def show
end

#updateObject



30
31
32
33
34
35
36
37
38
39
40
41
42
43
# File 'app/controllers/iformats_controller.rb', line 30

def update
  @iformat.update_attributes(params[:iformat])

  respond_to do |format|
    format.html do
      if @iformat.errors.empty?
        redirect_to :action => 'show'
      else
        render :action => 'edit'
      end
    end
    format.js { render :action => 'show' }
  end
end