Class: Spud::Admin::InquiryFormsController

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

Instance Method Summary collapse

Instance Method Details

#createObject



21
22
23
24
25
26
# File 'app/controllers/spud/admin/inquiry_forms_controller.rb', line 21

def create
	@inquiry_form = SpudInquiryForm.new(inquiry_form_params)
	flash[:notice] = "Form saved successfully!" if @inquiry_form.save

	respond_with @inquiry_form,:location => spud_admin_inquiry_forms_url
end

#destroyObject



40
41
42
43
44
45
46
# File 'app/controllers/spud/admin/inquiry_forms_controller.rb', line 40

def destroy
	flash[:notice] = "Inquiry form removed!" if @inquiry_form.destroy
	if Spud::Inquiries.enable_action_caching
		Rails.cache.clear
	end
	respond_with @inquiry_form,:location => spud_admin_inquiry_forms_url
end

#editObject



28
29
30
# File 'app/controllers/spud/admin/inquiry_forms_controller.rb', line 28

def edit
	respond_with @inquiry_form
end

#indexObject



11
12
13
14
# File 'app/controllers/spud/admin/inquiry_forms_controller.rb', line 11

def index
	@inquiry_forms = SpudInquiryForm.order(:name).paginate :page => params[:page]
	respond_with @inquiry_forms
end

#newObject



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

def new
	@inquiry_form = SpudInquiryForm.new
	respond_with @inquiry_form
end

#updateObject



32
33
34
35
36
37
38
# File 'app/controllers/spud/admin/inquiry_forms_controller.rb', line 32

def update
	flash[:notice] = "Form saved successfully!" if @inquiry_form.update_attributes(inquiry_form_params)
	if Spud::Inquiries.enable_action_caching
		Rails.cache.clear
	end
	respond_with @inquiry_form, :location => spud_admin_inquiry_forms_url
end