Class: Admin::AlphabeticIndicesController

Inherits:
AdminController
  • Object
show all
Defined in:
app/controllers/admin/alphabetic_indices_controller.rb

Overview

This RESTful controller is used to orchestrate and control the flow of the application relating to AlphabeticIndex objects.

Instance Method Summary (collapse)

Instance Method Details

- (Object) create

  • POST /admin/alphabetic_indices

  • POST /admin/alphabetic_indices.xml



44
45
46
47
48
49
50
51
52
53
54
55
56
57
# File 'app/controllers/admin/alphabetic_indices_controller.rb', line 44

def create
  @alphabetic_index        = AlphabeticIndex.new(params[:alphabetic_index])
  @alphabetic_index.parent = @parent_node

  respond_to do |format|
    if @alphabetic_index.save
      format.html { render :template => 'admin/shared/create' }
      format.xml  { head :ok }
    else
      format.html { render :template => 'admin/shared/new', :locals => { :object => @alphabetic_index }, :status => :unprocessable_entity }
      format.xml  { render :xml => @alphabetic_index.errors, :status => :unprocessable_entity }
    end
  end
end

- (Object) edit

  • GET /admin/alphabetic_indices/:id/edit



34
35
36
37
38
39
40
# File 'app/controllers/admin/alphabetic_indices_controller.rb', line 34

def edit
  @alphabetic_index.attributes = params[:alphabetic_index]

  respond_to do |format|
    format.html { render :template => 'admin/shared/edit', :locals => { :object => @alphabetic_index }}
  end
end

- (Object) new

  • GET /admin/alphabetic_indices/new



25
26
27
28
29
30
31
# File 'app/controllers/admin/alphabetic_indices_controller.rb', line 25

def new
  @alphabetic_index = AlphabeticIndex.new(params[:alphabetic_index])

  respond_to do |format|
    format.html { render :template => 'admin/shared/new', :locals => { :object => @alphabetic_index }}
  end
end

- (Object) show

  • GET /alhpabetic_indices/:id

  • GET /alphabetic_indices/:id.xml



17
18
19
20
21
22
# File 'app/controllers/admin/alphabetic_indices_controller.rb', line 17

def show
  respond_to do |format|
    format.html { render :partial => :show, :layout => 'admin/admin_show' }
    format.xml  { render :xml => @alphabetic_index }
  end
end

- (Object) update

  • PUT /admin/alphabetic_indices/:id

  • PUT /admin/alphabetic_indices/:id.xml



61
62
63
64
65
66
67
68
69
70
71
72
73
# File 'app/controllers/admin/alphabetic_indices_controller.rb', line 61

def update
  @alphabetic_index.attributes = params[:alphabetic_index]

  respond_to do |format|
    if @alphabetic_index.save
      format.html { render :template => 'admin/shared/update' }
      format.xml  { head :ok }
    else
      format.html { render :template => 'admin/shared/edit', :locals => { :object => @alphabetic_index }, :status => :unprocessable_entity }
      format.xml  { render :xml => @alphabetic_index.errors, :status => :unprocessable_entity }
    end
  end
end