Class: EntitiesController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- EntitiesController
- Defined in:
- app/controllers/entities_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/>.
Direct Known Subclasses
AccountsController, CampaignsController, ContactsController, LeadsController, OpportunitiesController
Instance Method Summary collapse
-
#attach ⇒ Object
Common attach handler for all core controllers.
-
#contacts ⇒ Object
GET /entities/contacts AJAX —————————————————————————-.
-
#discard ⇒ Object
Common discard handler for all core controllers.
-
#leads ⇒ Object
GET /entities/leads AJAX —————————————————————————-.
-
#opportunities ⇒ Object
GET /entities/opportunities AJAX —————————————————————————-.
-
#subscribe ⇒ Object
Common subscribe handler for all core controllers.
-
#unsubscribe ⇒ Object
Common unsubscribe handler for all core controllers.
-
#versions ⇒ Object
GET /entities/versions AJAX —————————————————————————-.
Methods inherited from ApplicationController
Instance Method Details
#attach ⇒ Object
Common attach handler for all core controllers.
30 31 32 33 34 35 36 |
# File 'app/controllers/entities_controller.rb', line 30 def attach @attachment = params[:assets].classify.constantize.find(params[:asset_id]) @attached = entity.attach!(@attachment) entity.reload respond_with(entity) end |
#contacts ⇒ Object
GET /entities/contacts AJAX
72 73 |
# File 'app/controllers/entities_controller.rb', line 72 def contacts end |
#discard ⇒ Object
Common discard handler for all core controllers.
40 41 42 43 44 45 46 |
# File 'app/controllers/entities_controller.rb', line 40 def discard @attachment = params[:attachment].constantize.find(params[:attachment_id]) entity.discard!(@attachment) entity.reload respond_with(entity) end |
#leads ⇒ Object
GET /entities/leads AJAX
77 78 |
# File 'app/controllers/entities_controller.rb', line 77 def leads end |
#opportunities ⇒ Object
GET /entities/opportunities AJAX
82 83 |
# File 'app/controllers/entities_controller.rb', line 82 def opportunities end |
#subscribe ⇒ Object
Common subscribe handler for all core controllers.
50 51 52 53 54 55 56 57 |
# File 'app/controllers/entities_controller.rb', line 50 def subscribe entity.subscribed_users += [current_user.id] entity.save respond_with(entity) do |format| format.js { render 'subscription_update' } end end |
#unsubscribe ⇒ Object
Common unsubscribe handler for all core controllers.
61 62 63 64 65 66 67 68 |
# File 'app/controllers/entities_controller.rb', line 61 def unsubscribe entity.subscribed_users -= [current_user.id] entity.save respond_with(entity) do |format| format.js { render 'subscription_update' } end end |
#versions ⇒ Object
GET /entities/versions AJAX
87 88 |
# File 'app/controllers/entities_controller.rb', line 87 def versions end |