Class: Admin::TagsController

Inherits:
ApplicationController
  • Object
show all
Defined in:
app/controllers/admin/tags_controller.rb

Overview

Copyright © 2008-2013 Michael Dvorkin and contributors.

Fat Free CRM is freely distributable under the terms of MIT license. See MIT-LICENSE file or www.opensource.org/licenses/mit-license.php


Instance Method Summary collapse

Instance Method Details

#confirmObject

GET /admin/tags/1/confirm AJAX




63
64
# File 'app/controllers/admin/tags_controller.rb', line 63

def confirm
end

#createObject

POST /admin/tags POST /admin/tags.xml AJAX




37
38
39
40
41
# File 'app/controllers/admin/tags_controller.rb', line 37

def create
  @tag.update(tag_params)

  respond_with(@tag)
end

#destroyObject

DELETE /admin/tags/1 DELETE /admin/tags/1.xml AJAX




55
56
57
58
59
# File 'app/controllers/admin/tags_controller.rb', line 55

def destroy
  @tag.destroy

  respond_with(@tag)
end

#editObject

GET /admin/tags/1/edit AJAX




30
31
32
# File 'app/controllers/admin/tags_controller.rb', line 30

def edit
  @previous = Tag.find_by_id(Regexp.last_match[1]) || Regexp.last_match[1].to_i if params[:previous].to_s =~ /(\d+)\z/
end

#indexObject

GET /admin/tags GET /admin/tags.xml HTML




16
17
18
19
# File 'app/controllers/admin/tags_controller.rb', line 16

def index
  @tags = Tag.all
  respond_with(@tags)
end

#newObject

GET /admin/tags/new GET /admin/tags/new.xml AJAX




24
25
26
# File 'app/controllers/admin/tags_controller.rb', line 24

def new
  respond_with(@tag)
end

#updateObject

PUT /admin/tags/1 PUT /admin/tags/1.xml AJAX




46
47
48
49
50
# File 'app/controllers/admin/tags_controller.rb', line 46

def update
  @tag.update(tag_params)

  respond_with(@tag)
end