class ThumbsController < ApplicationController # GET /thumbs # GET /thumbs.xml def index @thumbs = Thumb.find(:all, :conditions=>["thumbnail is null"]) respond_to do |format| format.html # index.rhtml format.xml { render :xml => @thumbs.to_xml } end end # GET /thumbs/1 # GET /thumbs/1.xml def show @thumb = Thumb.find(params[:id]) respond_to do |format| format.html # show.rhtml format.xml { render :xml => @thumb.to_xml } end end # GET /thumbs/new def new @thumb = Thumb.new end # GET /thumbs/1;edit def edit @thumb = Thumb.find(params[:id]) end # POST /thumbs # POST /thumbs.xml def create @thumb = Thumb.new(params[:thumb]) respond_to do |format| if @thumb.save flash[:notice] = 'Thumb was successfully created.' format.html { redirect_to thumb_url(@thumb) } format.xml { head :created, :location => thumb_url(@thumb) } else format.html { render :action => "new" } format.xml { render :xml => @thumb.errors.to_xml } end end end # PUT /thumbs/1 # PUT /thumbs/1.xml def update @thumb = Thumb.find(params[:id]) respond_to do |format| if @thumb.update_attributes(params[:thumb]) flash[:notice] = 'Thumb was successfully updated.' format.html { redirect_to thumb_url(@thumb) } format.xml { head :ok } else format.html { render :action => "edit" } format.xml { render :xml => @thumb.errors.to_xml } end end end # DELETE /thumbs/1 # DELETE /thumbs/1.xml def destroy @thumb = Thumb.find(params[:id]) @thumb.destroy respond_to do |format| format.html { redirect_to thumbs_url } format.xml { head :ok } end end end