Class: Kaui::TagDefinitionsController
- Inherits:
-
EngineController
- Object
- ApplicationController
- EngineController
- Kaui::TagDefinitionsController
- Defined in:
- app/controllers/kaui/tag_definitions_controller.rb
Instance Method Summary collapse
-
#create ⇒ Object
POST /tag_definitions POST /tag_definitions.json.
-
#destroy ⇒ Object
DELETE /tag_definitions/1 DELETE /tag_definitions/1.json.
-
#edit ⇒ Object
GET /tag_definitions/1/edit.
-
#index ⇒ Object
GET /tag_definitions GET /tag_definitions.json.
-
#new ⇒ Object
GET /tag_definitions/new GET /tag_definitions/new.json.
-
#show ⇒ Object
GET /tag_definitions/1 GET /tag_definitions/1.json.
-
#update ⇒ Object
PUT /tag_definitions/1 PUT /tag_definitions/1.json.
Methods inherited from EngineController
Methods included from ErrorHelper
Instance Method Details
#create ⇒ Object
POST /tag_definitions POST /tag_definitions.json
48 49 50 51 52 53 54 55 56 57 58 59 60 |
# File 'app/controllers/kaui/tag_definitions_controller.rb', line 48 def create @tag_definition = TagDefinition.new(params[:tag_definition]) respond_to do |format| if @tag_definition.save format.html { redirect_to @tag_definition, :notice => 'Tag definition was successfully created.' } format.json { render :json => @tag_definition, :status => :created, :location => @tag_definition } else format.html { render :action => "new" } format.json { render :json => @tag_definition.errors, :status => :unprocessable_entity } end end end |
#destroy ⇒ Object
DELETE /tag_definitions/1 DELETE /tag_definitions/1.json
80 81 82 83 84 85 86 87 88 |
# File 'app/controllers/kaui/tag_definitions_controller.rb', line 80 def destroy @tag_definition = TagDefinition.find(params[:id]) @tag_definition.destroy respond_to do |format| format.html { redirect_to tag_definitions_url } format.json { head :no_content } end end |
#edit ⇒ Object
GET /tag_definitions/1/edit
42 43 44 |
# File 'app/controllers/kaui/tag_definitions_controller.rb', line 42 def edit @tag_definition = TagDefinition.find(params[:id]) end |
#index ⇒ Object
GET /tag_definitions GET /tag_definitions.json
5 6 7 8 9 10 11 12 13 14 15 16 17 |
# File 'app/controllers/kaui/tag_definitions_controller.rb', line 5 def index begin @tag_definitions = TagDefinition.all rescue => e flash[:error] = "Error while retrieving tag definitions: #{as_string(e)}" @tag_definitions = [] end respond_to do |format| format.html # index.html.erb format.json { render :json => @tag_definitions } end end |
#new ⇒ Object
GET /tag_definitions/new GET /tag_definitions/new.json
32 33 34 35 36 37 38 39 |
# File 'app/controllers/kaui/tag_definitions_controller.rb', line 32 def new @tag_definition = TagDefinition.new respond_to do |format| format.html # new.html.erb format.json { render :json => @tag_definition } end end |
#show ⇒ Object
GET /tag_definitions/1 GET /tag_definitions/1.json
21 22 23 24 25 26 27 28 |
# File 'app/controllers/kaui/tag_definitions_controller.rb', line 21 def show @tag_definition = TagDefinition.find(params[:id]) respond_to do |format| format.html # show.html.erb format.json { render :json => @tag_definition } end end |
#update ⇒ Object
PUT /tag_definitions/1 PUT /tag_definitions/1.json
64 65 66 67 68 69 70 71 72 73 74 75 76 |
# File 'app/controllers/kaui/tag_definitions_controller.rb', line 64 def update @tag_definition = TagDefinition.find(params[:id]) respond_to do |format| if @tag_definition.update_attributes(params[:tag_definition]) format.html { redirect_to @tag_definition, :notice => 'Tag definition was successfully updated.' } format.json { head :no_content } else format.html { render :action => "edit" } format.json { render :json => @tag_definition.errors, :status => :unprocessable_entity } end end end |