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




65
66
# File 'app/controllers/admin/tags_controller.rb', line 65

def confirm
end

#createObject

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




39
40
41
42
43
# File 'app/controllers/admin/tags_controller.rb', line 39

def create
  @tag.update_attributes(tag_params)

  respond_with(@tag)
end

#destroyObject

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




57
58
59
60
61
# File 'app/controllers/admin/tags_controller.rb', line 57

def destroy
  @tag.destroy

  respond_with(@tag)
end

#editObject

GET /admin/tags/1/edit AJAX




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

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




48
49
50
51
52
# File 'app/controllers/admin/tags_controller.rb', line 48

def update
  @tag.update_attributes(tag_params)

  respond_with(@tag)
end