Class: PageCommentTypesController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- PageCommentTypesController
- Defined in:
- app/controllers/page_comment_types_controller.rb
Instance Method Summary collapse
-
#create ⇒ Object
POST /page_comment_types POST /page_comment_types.xml.
-
#destroy ⇒ Object
DELETE /page_comment_types/1 DELETE /page_comment_types/1.xml.
-
#edit ⇒ Object
GET /page_comment_types/1/edit.
-
#index ⇒ Object
GET /page_comment_types GET /page_comment_types.xml.
-
#new ⇒ Object
GET /page_comment_types/new GET /page_comment_types/new.xml.
-
#show ⇒ Object
GET /page_comment_types/1 GET /page_comment_types/1.xml.
-
#update ⇒ Object
PUT /page_comment_types/1 PUT /page_comment_types/1.xml.
Methods inherited from ApplicationController
Instance Method Details
#create ⇒ Object
POST /page_comment_types POST /page_comment_types.xml
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 |
# File 'app/controllers/page_comment_types_controller.rb', line 34 def create if (:staff, page_comment_types_url) @page_comment_type = PageCommentType.new(params[:page_comment_type]) respond_to do |format| if @page_comment_type.save flash[:notice] = 'PageCommentType was successfully created.' format.html { redirect_to(@page_comment_type) } format.xml { render :xml => @page_comment_type, :status => :created, :location => @page_comment_type } else format.html { render :action => "new" } format.xml { render :xml => @page_comment_type.errors, :status => :unprocessable_entity } end end end end |
#destroy ⇒ Object
DELETE /page_comment_types/1 DELETE /page_comment_types/1.xml
73 74 75 76 77 78 79 80 81 82 83 |
# File 'app/controllers/page_comment_types_controller.rb', line 73 def destroy if (:admin, page_comment_types_url) @page_comment_type = PageCommentType.find(params[:id]) @page_comment_type.destroy respond_to do |format| format.html { redirect_to(page_comment_types_url) } format.xml { head :ok } end end end |
#edit ⇒ Object
GET /page_comment_types/1/edit
26 27 28 29 30 |
# File 'app/controllers/page_comment_types_controller.rb', line 26 def edit if (:staff, page_comment_types_url) @page_comment_type = PageCommentType.find(params[:id]) end end |
#index ⇒ Object
GET /page_comment_types GET /page_comment_types.xml
6 7 8 |
# File 'app/controllers/page_comment_types_controller.rb', line 6 def index @page_comment_types = PageCommentType.all end |
#new ⇒ Object
GET /page_comment_types/new GET /page_comment_types/new.xml
18 19 20 21 22 23 |
# File 'app/controllers/page_comment_types_controller.rb', line 18 def new if (:staff, page_comment_types_url) @page_comment_type = PageCommentType.new end end |
#show ⇒ Object
GET /page_comment_types/1 GET /page_comment_types/1.xml
12 13 14 |
# File 'app/controllers/page_comment_types_controller.rb', line 12 def show @page_comment_type = PageCommentType.find(params[:id]) end |
#update ⇒ Object
PUT /page_comment_types/1 PUT /page_comment_types/1.xml
54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 |
# File 'app/controllers/page_comment_types_controller.rb', line 54 def update if (:staff, page_comment_types_url) @page_comment_type = PageCommentType.find(params[:id]) respond_to do |format| if @page_comment_type.update_attributes(params[:page_comment_type]) flash[:notice] = 'PageCommentType was successfully updated.' format.html { redirect_to(@page_comment_type) } format.xml { head :ok } else format.html { render :action => "edit" } format.xml { render :xml => @page_comment_type.errors, :status => :unprocessable_entity } end end end end |