Class: Manage::TrackableTagsController

Inherits:
ApplicationController
  • Object
show all
Defined in:
app/controllers/manage/trackable_tags_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject

POST /manage/trackable_tags



28
29
30
31
32
33
34
35
36
37
# File 'app/controllers/manage/trackable_tags_controller.rb', line 28

def create
  @trackable_tag = TrackableTag.new(trackable_tag_params)

  if @trackable_tag.save
    flash[:notice] = 'Trackable tag was successfully created.'
    respond_with(:manage, @trackable_tag)
  else
    render :new
  end
end

#destroyObject

DELETE /manage/trackable_tags/1



50
51
52
53
54
# File 'app/controllers/manage/trackable_tags_controller.rb', line 50

def destroy
  @trackable_tag.destroy
  flash[:notice] = 'Trackable tag was successfully destroyed.'
  respond_with(:manage, @trackable_tag)
end

#editObject

GET /manage/trackable_tags/1/edit



24
25
# File 'app/controllers/manage/trackable_tags_controller.rb', line 24

def edit
end

#indexObject

GET /manage/trackable_tags



7
8
9
10
# File 'app/controllers/manage/trackable_tags_controller.rb', line 7

def index
  @trackable_tags = TrackableTag.all
  respond_with(:manage, @trackable_tags)
end

#newObject

GET /manage/trackable_tags/new



18
19
20
21
# File 'app/controllers/manage/trackable_tags_controller.rb', line 18

def new
  @trackable_tag = TrackableTag.new
  respond_with(:manage, @questionnaire)
end

#showObject

GET /manage/trackable_tags/1



13
14
15
# File 'app/controllers/manage/trackable_tags_controller.rb', line 13

def show
  respond_with(:manage, @trackable_tag)
end

#updateObject

PATCH/PUT /manage/trackable_tags/1



40
41
42
43
44
45
46
47
# File 'app/controllers/manage/trackable_tags_controller.rb', line 40

def update
  if @trackable_tag.update(trackable_tag_params)
    flash[:notice] = 'Trackable tag was successfully updated.'
    respond_with(:manage, @trackable_tag)
  else
    render :edit
  end
end