Class: Spud::Admin::InquiryFormsController

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

Instance Method Summary collapse

Instance Method Details

#createObject



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

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

	respond_with @inquiry_form,:location => spud_admin_inquiry_forms_url
end

#destroyObject



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

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

#editObject



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

def edit
	respond_with @inquiry_form
end

#indexObject



8
9
10
11
12
# File 'app/controllers/spud/admin/inquiry_forms_controller.rb', line 8

def index

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

#newObject



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

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

#updateObject



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

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