Class: Certify::AuthoritiesController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- Certify::AuthoritiesController
- Defined in:
- app/controllers/certify/authorities_controller.rb
Instance Method Summary collapse
-
#create ⇒ Object
POST /authorities POST /authorities.json.
-
#destroy ⇒ Object
DELETE /authorities/1 DELETE /authorities/1.json.
-
#index ⇒ Object
GET /authorities GET /authorities.json.
-
#new ⇒ Object
GET /authorities/new GET /authorities/new.json.
-
#show ⇒ Object
GET /authorities/1 GET /authorities/1.json.
Instance Method Details
#create ⇒ Object
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 |
#destroy ⇒ Object
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 } format.json { head :no_content } end end |
#index ⇒ Object
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 |
#new ⇒ Object
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 |
#show ⇒ Object
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 |