Class: Phcmemberspro::Directory::CatlistsController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- Phcmemberspro::Directory::CatlistsController
- Defined in:
- app/controllers/phcmemberspro/directory/catlists_controller.rb
Instance Method Summary collapse
-
#create ⇒ Object
Create Directory Listing Action.
-
#destroy ⇒ Object
Delete Directory Listing.
- #directorycategory ⇒ Object
-
#edit ⇒ Object
Edit Directory Listing Action.
-
#index ⇒ Object
Directory Listing Index.
-
#new ⇒ Object
New Directory Listing.
-
#show ⇒ Object
Show Directory Listing.
-
#update ⇒ Object
Update Directory Listing Action.
Methods inherited from ApplicationController
Instance Method Details
#create ⇒ Object
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(current_account).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 |
#destroy ⇒ Object
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 |
#directorycategory ⇒ Object
14 15 16 |
# File 'app/controllers/phcmemberspro/directory/catlists_controller.rb', line 14 def directorycategory @directory_category = Directory::Category.find(params[:category_id]) end |
#edit ⇒ Object
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(current_account).find(params[:id]) respond_to do |format| format.html # new.html.erb format.xml { render :xml => @directory_catlist } end end |
#index ⇒ Object
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(current_account) end |
#new ⇒ Object
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(current_account).build end |
#show ⇒ Object
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(current_account).find(params[:id]) end |
#update ⇒ Object
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 |