Class: Manage::TrackableTagsController

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

Instance Method Summary collapse

Methods inherited from ApplicationController

#json_request?, #limit_write_access_to_admins, #logged_in, #require_admin_or_limited_admin, #require_admin_or_limited_admin_or_event_tracking, #response_view_or_errors

Instance Method Details

#createObject

POST /manage/trackable_tags



31
32
33
34
35
36
37
38
39
40
# File 'app/controllers/manage/trackable_tags_controller.rb', line 31

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
    response_view_or_errors :new, @trackable_tag
  end
end

#destroyObject

DELETE /manage/trackable_tags/1



53
54
55
56
57
# File 'app/controllers/manage/trackable_tags_controller.rb', line 53

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



27
28
# File 'app/controllers/manage/trackable_tags_controller.rb', line 27

def edit
end

#indexObject

GET /manage/trackable_tags



10
11
12
13
# File 'app/controllers/manage/trackable_tags_controller.rb', line 10

def index
  @trackable_tags = TrackableTag.all.order("name ASC")
  respond_with(:manage, @trackable_tags)
end

#newObject

GET /manage/trackable_tags/new



21
22
23
24
# File 'app/controllers/manage/trackable_tags_controller.rb', line 21

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

#showObject

GET /manage/trackable_tags/1



16
17
18
# File 'app/controllers/manage/trackable_tags_controller.rb', line 16

def show
  respond_with(:manage, @trackable_tag)
end

#updateObject

PATCH/PUT /manage/trackable_tags/1



43
44
45
46
47
48
49
50
# File 'app/controllers/manage/trackable_tags_controller.rb', line 43

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