1 class ThumbsController < ApplicationController
7 @thumbs = Thumb.paginate(:page => params[:page])
10 format.html # index.html.erb
11 format.xml { render :xml => @thumbs }
18 @thumb = Thumb.find(params[:id])
20 respond_to do |format|
21 format.html # show.html.erb
22 format.xml { render :xml => @thumb }
31 respond_to do |format|
32 format.html # new.html.erb
33 format.xml { render :xml => @thumb }
39 @thumb = Thumb.find(params[:id])
45 @thumb = Thumb.new(params[:thumb])
46 @thumb.video_id = params[:thumb].delete(:video_id)
48 respond_to do |format|
50 flash[:notice] = 'Thumb was successfully created.'
51 format.html { redirect_to(@thumb) }
52 format.xml { render :xml => @thumb, :status => :created, :location => @thumb }
54 format.html { render :action => "new" }
55 format.xml { render :xml => @thumb.errors, :status => :unprocessable_entity }
63 @thumb = Thumb.find(params[:id])
65 respond_to do |format|
66 if @thumb.update_attributes(params[:thumb])
67 flash[:notice] = 'Thumb was successfully updated.'
68 format.html { redirect_to(@thumb) }
69 format.xml { head :ok }
71 format.html { render :action => "edit" }
72 format.xml { render :xml => @thumb.errors, :status => :unprocessable_entity }
78 # DELETE /thumbs/1.xml
80 @thumb = Thumb.find(params[:id])
83 respond_to do |format|
84 format.html { redirect_to(thumbs_url) }
85 format.xml { head :ok }