Class: PixelFire::TagsController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- PixelFire::TagsController
- Defined in:
- app/controllers/pixel_fire/tags_controller.rb
Instance Method Summary collapse
-
#create ⇒ Object
POST /tags.
-
#destroy ⇒ Object
DELETE /tags/1.
-
#edit ⇒ Object
GET /tags/1/edit.
-
#index ⇒ Object
GET /tags.
-
#new ⇒ Object
GET /tags/new.
-
#show ⇒ Object
GET /tags/1.
-
#update ⇒ Object
PATCH/PUT /tags/1.
Instance Method Details
#create ⇒ Object
POST /tags
26 27 28 29 30 31 32 33 34 35 |
# File 'app/controllers/pixel_fire/tags_controller.rb', line 26 def create @tag = Tag.new(tag_params) if @tag.save @tag.update_triggers(params[:trigger_ids]) redirect_to @tag, notice: 'Tag was successfully created.' else render :new end end |
#destroy ⇒ Object
DELETE /tags/1
48 49 50 51 |
# File 'app/controllers/pixel_fire/tags_controller.rb', line 48 def destroy @tag.destroy redirect_to , notice: 'Tag was successfully destroyed.' end |
#edit ⇒ Object
GET /tags/1/edit
22 23 |
# File 'app/controllers/pixel_fire/tags_controller.rb', line 22 def edit end |
#index ⇒ Object
GET /tags
8 9 10 |
# File 'app/controllers/pixel_fire/tags_controller.rb', line 8 def index = Tag.all end |
#new ⇒ Object
GET /tags/new
17 18 19 |
# File 'app/controllers/pixel_fire/tags_controller.rb', line 17 def new @tag = Tag.new end |
#show ⇒ Object
GET /tags/1
13 14 |
# File 'app/controllers/pixel_fire/tags_controller.rb', line 13 def show end |
#update ⇒ Object
PATCH/PUT /tags/1
38 39 40 41 42 43 44 45 |
# File 'app/controllers/pixel_fire/tags_controller.rb', line 38 def update if @tag.update(tag_params) @tag.update_triggers(params[:trigger_ids]) redirect_to @tag, notice: 'Tag was successfully updated.' else render :edit end end |