Class: Phcmemberspro::Directory::CatlistsController

Inherits:
ApplicationController show all
Defined in:
app/controllers/phcmemberspro/directory/catlists_controller.rb

Instance Method Summary collapse

Methods inherited from ApplicationController

#current_account, #scoped_to

Instance Method Details

#createObject

Create Directory Listing Action



47
48
49
50
51
52
53
54
55
56
57
58
59
# File 'app/controllers/phcmemberspro/directory/catlists_controller.rb', line 47

def create
	@category = Directory::Category.find(params[:category_id])
	@directory_catlist = @category.catlists.scoped_to().create(directory_catlist_params)
	respond_to do |format|
		if @directory_catlist.save
			format.html { redirect_to directory_category_catlists_path, notice: 'Comment for Directorycategory was Successfully Created.' }
			format.json { render action: 'show', status: :created, location: @directory_catlist }
			else
				format.html { render action: 'new' }
				format.json { render json: @directory_catlist.errors, status: :unprocessable_entity }
		end
	end
end

#destroyObject

Delete Directory Listing



75
76
77
78
79
80
81
82
83
# File 'app/controllers/phcmemberspro/directory/catlists_controller.rb', line 75

def destroy
	@category = Directory::Category.find(params[:category_id])
	@directory_catlist = @category.catlists.find(params[:id])
	@directory_catlist.destroy
	respond_to do |format|
		format.html { redirect_to directory_category_catlists_path, notice: 'Comment for Directorycategory was Successfully Deleted.'  }
		format.json { head :no_content }
	end
end

#directorycategoryObject



14
15
16
# File 'app/controllers/phcmemberspro/directory/catlists_controller.rb', line 14

def directorycategory  
	@directory_category = Directory::Category.find(params[:category_id])
end

#editObject

Edit Directory Listing Action



37
38
39
40
41
42
43
44
# File 'app/controllers/phcmemberspro/directory/catlists_controller.rb', line 37

def edit
	category = Directory::Category.find(params[:category_id])
	@directory_catlist = category.catlists.scoped_to().find(params[:id])
	respond_to do |format|
		format.html # new.html.erb
		format.xml  { render :xml => @directory_catlist }
	end
end

#indexObject

Directory Listing Index



19
20
21
22
# File 'app/controllers/phcmemberspro/directory/catlists_controller.rb', line 19

def index
	category = Directory::Category.find(params[:category_id])
	@directory_catlists = category.catlists.scoped_to()
end

#newObject

New Directory Listing



31
32
33
34
# File 'app/controllers/phcmemberspro/directory/catlists_controller.rb', line 31

def new
	category = Directory::Category.find(params[:category_id])
	@directory_catlist = category.catlists.scoped_to().build
end

#showObject

Show Directory Listing



25
26
27
28
# File 'app/controllers/phcmemberspro/directory/catlists_controller.rb', line 25

def show
	category = Directory::Category.find(params[:category_id])
	@directory_catlist = category.catlists.scoped_to().find(params[:id])
end

#updateObject

Update Directory Listing Action



62
63
64
65
66
67
68
69
70
71
72
# File 'app/controllers/phcmemberspro/directory/catlists_controller.rb', line 62

def update
	respond_to do |format|
		if @directory_catlist.update(directory_catlist_params)
			format.html { redirect_to directory_category_catlists_path, notice: 'Comment for Directorycategory was Successfully Updated.' }
			format.json { head :no_content }
			else
				format.html { render action: 'edit' }
				format.json { render json: @directory_catlist.errors, status: :unprocessable_entity }
		end
	end
end