Class: Admin::TagsController

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

Overview

Fat Free CRM Copyright © 2008-2011 by Michael Dvorkin

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License along with this program. If not, see <www.gnu.org/licenses/>.


Instance Method Summary collapse

Instance Method Details

#confirmObject

GET /admin/tags/1/confirm AJAX




74
75
# File 'app/controllers/admin/tags_controller.rb', line 74

def confirm
end

#createObject

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




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

def create
  @tag.update_attributes(params[:tag])

  respond_with(@tag)
end

#destroyObject

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




66
67
68
69
70
# File 'app/controllers/admin/tags_controller.rb', line 66

def destroy
  @tag.destroy

  respond_with(@tag)
end

#editObject

GET /admin/tags/1/edit AJAX




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

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

#indexObject

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




26
27
28
# File 'app/controllers/admin/tags_controller.rb', line 26

def index
  respond_with(@tags)
end

#newObject

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




33
34
35
# File 'app/controllers/admin/tags_controller.rb', line 33

def new
  respond_with(@tag)
end

#updateObject

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




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

def update
  @tag.update_attributes(params[:tag])

  respond_with(@tag)
end