Class: ScottyDogSayingsController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- ScottyDogSayingsController
- Defined in:
- app/controllers/scotty_dog_sayings_controller.rb
Instance Method Summary collapse
-
#create ⇒ Object
POST /scotty_dog_sayings POST /scotty_dog_sayings.xml.
-
#destroy ⇒ Object
DELETE /scotty_dog_sayings/1 DELETE /scotty_dog_sayings/1.xml.
-
#edit ⇒ Object
GET /scotty_dog_sayings/1/edit.
-
#index ⇒ Object
GET /scotty_dog_sayings GET /scotty_dog_sayings.xml.
-
#new ⇒ Object
GET /scotty_dog_sayings/new GET /scotty_dog_sayings/new.xml.
-
#show ⇒ Object
GET /scotty_dog_sayings/1 GET /scotty_dog_sayings/1.xml.
-
#update ⇒ Object
PUT /scotty_dog_sayings/1 PUT /scotty_dog_sayings/1.xml.
Methods inherited from ApplicationController
Instance Method Details
#create ⇒ Object
POST /scotty_dog_sayings POST /scotty_dog_sayings.xml
46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 |
# File 'app/controllers/scotty_dog_sayings_controller.rb', line 46 def create = .new(params[:scotty_dog_saying]) .user_id = current_user.id if current_user respond_to do |format| if .save flash[:notice] = 'Thank you for adding to my reprotoire. Scotty Dog Saying was successfully created.' format.html { redirect_to() } format.xml { render :xml => , :status => :created, :location => } else format.html { render :action => "new" } format.xml { render :xml => .errors, :status => :unprocessable_entity } end end end |
#destroy ⇒ Object
DELETE /scotty_dog_sayings/1 DELETE /scotty_dog_sayings/1.xml
81 82 83 84 85 86 87 88 89 |
# File 'app/controllers/scotty_dog_sayings_controller.rb', line 81 def destroy = .find(params[:id]) .destroy respond_to do |format| format.html { redirect_to() } format.xml { head :ok } end end |
#edit ⇒ Object
GET /scotty_dog_sayings/1/edit
40 41 42 |
# File 'app/controllers/scotty_dog_sayings_controller.rb', line 40 def edit = .find(params[:id]) end |
#index ⇒ Object
GET /scotty_dog_sayings GET /scotty_dog_sayings.xml
8 9 10 11 12 13 14 15 |
# File 'app/controllers/scotty_dog_sayings_controller.rb', line 8 def index = .all respond_to do |format| format.html # index.html.erb format.xml { render :xml => } end end |
#new ⇒ Object
GET /scotty_dog_sayings/new GET /scotty_dog_sayings/new.xml
30 31 32 33 34 35 36 37 |
# File 'app/controllers/scotty_dog_sayings_controller.rb', line 30 def new = .new respond_to do |format| format.html # new.html.erb format.xml { render :xml => } end end |
#show ⇒ Object
GET /scotty_dog_sayings/1 GET /scotty_dog_sayings/1.xml
19 20 21 22 23 24 25 26 |
# File 'app/controllers/scotty_dog_sayings_controller.rb', line 19 def show = .find(params[:id]) respond_to do |format| format.html # show.html.erb format.xml { render :xml => } end end |
#update ⇒ Object
PUT /scotty_dog_sayings/1 PUT /scotty_dog_sayings/1.xml
64 65 66 67 68 69 70 71 72 73 74 75 76 77 |
# File 'app/controllers/scotty_dog_sayings_controller.rb', line 64 def update = .find(params[:id]) respond_to do |format| if .update_attributes(params[:scotty_dog_saying]) flash[:notice] = 'Thanks for giving me something better to say. Scotty Dog Saying was successfully updated.' format.html { redirect_to() } format.xml { head :ok } else format.html { render :action => "edit" } format.xml { render :xml => .errors, :status => :unprocessable_entity } end end end |