Sha256: 8b00488b72cc7c86173651416473603784305597171c91dd77d29b37ef5c1dc0

Contents?: true

Size: 1.83 KB

Versions: 62

Compression:

Stored size: 1.83 KB

Contents

class StarsController < ApplicationController
  # GET /stars
  # GET /stars.xml
  def index
    @stars = Star.all

    respond_to do |format|
      format.html # index.html.erb
      format.xml  { render :xml => @stars }
    end
  end

  # GET /stars/1
  # GET /stars/1.xml
  def show
    @star = Star.find(params[:id])

    respond_to do |format|
      format.html # show.html.erb
      format.xml  { render :xml => @star }
    end
  end

  # GET /stars/new
  # GET /stars/new.xml
  def new
    @star = Star.new

    respond_to do |format|
      format.html # new.html.erb
      format.xml  { render :xml => @star }
    end
  end

  # GET /stars/1/edit
  def edit
    @star = Star.find(params[:id])
  end

  # POST /stars
  # POST /stars.xml
  def create
    @star = Star.new(params[:star])

    respond_to do |format|
      if @star.save
        format.html { redirect_to(@star, :notice => 'Star was successfully created.') }
        format.xml  { render :xml => @star, :status => :created, :location => @star }
      else
        format.html { render :action => "new" }
        format.xml  { render :xml => @star.errors, :status => :unprocessable_entity }
      end
    end
  end

  # PUT /stars/1
  # PUT /stars/1.xml
  def update
    @star = Star.find(params[:id])

    respond_to do |format|
      if @star.update_attributes(params[:star])
        format.html { redirect_to(@star, :notice => 'Star was successfully updated.') }
        format.xml  { head :ok }
      else
        format.html { render :action => "edit" }
        format.xml  { render :xml => @star.errors, :status => :unprocessable_entity }
      end
    end
  end

  # DELETE /stars/1
  # DELETE /stars/1.xml
  def destroy
    @star = Star.find(params[:id])
    @star.destroy

    respond_to do |format|
      format.html { redirect_to(stars_url) }
      format.xml  { head :ok }
    end
  end
end

Version data entries

62 entries across 15 versions & 1 rubygems

Version Path
tabulous-2.1.3 spec/applications/simple_tabs/rails_3-0-20/app/controllers/stars_controller.rb
tabulous-2.1.3 spec/applications/subtabs/rails_3-0-20/app/controllers/stars_controller.rb
tabulous-2.1.3 spec/applications/custom_renderer/rails_3-0-20/app/controllers/stars_controller.rb
tabulous-2.1.3 spec/applications/main/rails_3-0-20/app/controllers/stars_controller.rb
tabulous-2.1.2 spec/applications/subtabs/rails_3-0-20/app/controllers/stars_controller.rb
tabulous-2.1.2 spec/applications/main/rails_3-0-20/app/controllers/stars_controller.rb
tabulous-2.1.2 spec/applications/custom_renderer/rails_3-0-20/app/controllers/stars_controller.rb
tabulous-2.1.2 spec/applications/simple_tabs/rails_3-0-20/app/controllers/stars_controller.rb
tabulous-2.1.1 spec/applications/custom_renderer/rails_3-0-20/app/controllers/stars_controller.rb
tabulous-2.1.1 spec/applications/main/rails_3-0-20/app/controllers/stars_controller.rb
tabulous-2.1.1 spec/applications/simple_tabs/rails_3-0-20/app/controllers/stars_controller.rb
tabulous-2.1.1 spec/applications/subtabs/rails_3-0-20/app/controllers/stars_controller.rb
tabulous-2.1.0 spec/applications/subtabs/rails_3-0-20/app/controllers/stars_controller.rb
tabulous-2.1.0 spec/applications/simple_tabs/rails_3-0-20/app/controllers/stars_controller.rb
tabulous-2.1.0 spec/applications/custom_renderer/rails_3-0-20/app/controllers/stars_controller.rb
tabulous-2.1.0 spec/applications/main/rails_3-0-20/app/controllers/stars_controller.rb
tabulous-2.0.0 spec/applications/simple_tabs/rails_3-0-20/app/controllers/stars_controller.rb
tabulous-2.0.0 spec/applications/subtabs/rails_3-0-20/app/controllers/stars_controller.rb
tabulous-2.0.0 spec/applications/custom_renderer/rails_3-0-20/app/controllers/stars_controller.rb
tabulous-2.0.0 spec/applications/main/rails_3-0-20/app/controllers/stars_controller.rb