Class: Certify::AuthoritiesController

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

Instance Method Summary collapse

Instance Method Details

#createObject

POST /authorities POST /authorities.json



38
39
40
41
42
43
44
45
46
47
48
49
50
# File 'app/controllers/certify/authorities_controller.rb', line 38

def create
  @authority = Authority.new(params[:authority])
  
  respond_to do |format|
    if @authority.save
      format.html { redirect_to @authority, notice: 'Authority was successfully created.' }
      format.json { render json: @authority, status: :created, location: @authority }
    else
      format.html { render action: "new" }
      format.json { render json: @authority.errors, status: :unprocessable_entity }
    end
  end
end

#destroyObject

DELETE /authorities/1 DELETE /authorities/1.json



54
55
56
57
58
59
60
61
62
# File 'app/controllers/certify/authorities_controller.rb', line 54

def destroy
  @authority = Authority.find(params[:id])
  @authority.destroy
  
  respond_to do |format|
    format.html { redirect_to authorities_url }
    format.json { head :no_content }
  end
end

#indexObject

GET /authorities GET /authorities.json



5
6
7
8
9
10
11
12
# File 'app/controllers/certify/authorities_controller.rb', line 5

def index
  @authorities = Authority.all
  
  respond_to do |format|
    format.html # _certificate_overview.html.erb
    format.json { render json: @authorities }
  end
end

#newObject

GET /authorities/new GET /authorities/new.json



27
28
29
30
31
32
33
34
# File 'app/controllers/certify/authorities_controller.rb', line 27

def new
  @authority = Authority.new
  
  respond_to do |format|
    format.html # new.html.erb
    format.json { render json: @authority }
  end
end

#showObject

GET /authorities/1 GET /authorities/1.json



16
17
18
19
20
21
22
23
# File 'app/controllers/certify/authorities_controller.rb', line 16

def show
  @authority = Authority.find(params[:id])
  
  respond_to do |format|
    format.html # show.html.erb
    format.json { render json: @authority }
  end
end