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_attributes(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




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

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




14
15
16
17
# File 'app/controllers/admin/tags_controller.rb', line 14

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

#newObject

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




22
23
24
# File 'app/controllers/admin/tags_controller.rb', line 22

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_attributes(tag_params)

  respond_with(@tag)
end