Sha256: 847aaaecc6b9f5ac5aa90f32d9fee5de1fd4b8f428fe56cc896579462d82b1ed

Contents?: true

Size: 1.96 KB

Versions: 22

Compression:

Stored size: 1.96 KB

Contents

class GalaxiesController < ApplicationController
  # GET /galaxies
  # GET /galaxies.json
  def index
    @galaxies = Galaxy.all

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

  # GET /galaxies/1
  # GET /galaxies/1.json
  def show
    @galaxy = Galaxy.find(params[:id])

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

  # GET /galaxies/new
  # GET /galaxies/new.json
  def new
    @galaxy = Galaxy.new

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

  # GET /galaxies/1/edit
  def edit
    @galaxy = Galaxy.find(params[:id])
  end

  # POST /galaxies
  # POST /galaxies.json
  def create
    @galaxy = Galaxy.new(params[:galaxy])

    respond_to do |format|
      if @galaxy.save
        format.html { redirect_to @galaxy, :notice => 'Galaxy was successfully created.' }
        format.json { render :json => @galaxy, :status => :created, :location => @galaxy }
      else
        format.html { render :action => "new" }
        format.json { render :json => @galaxy.errors, :status => :unprocessable_entity }
      end
    end
  end

  # PUT /galaxies/1
  # PUT /galaxies/1.json
  def update
    @galaxy = Galaxy.find(params[:id])

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

  # DELETE /galaxies/1
  # DELETE /galaxies/1.json
  def destroy
    @galaxy = Galaxy.find(params[:id])
    @galaxy.destroy

    respond_to do |format|
      format.html { redirect_to galaxies_url }
      format.json { head :no_content }
    end
  end
end

Version data entries

22 entries across 6 versions & 1 rubygems

Version Path
tabulous-2.1.3 spec/applications/bootstrap/rails_3-2-13/app/controllers/galaxies_controller.rb
tabulous-2.1.3 spec/applications/simple_tabs/rails_3-2-13/app/controllers/galaxies_controller.rb
tabulous-2.1.3 spec/applications/main/rails_3-2-13/app/controllers/galaxies_controller.rb
tabulous-2.1.3 spec/applications/custom_renderer/rails_3-2-13/app/controllers/galaxies_controller.rb
tabulous-2.1.2 spec/applications/custom_renderer/rails_3-2-13/app/controllers/galaxies_controller.rb
tabulous-2.1.2 spec/applications/simple_tabs/rails_3-2-13/app/controllers/galaxies_controller.rb
tabulous-2.1.2 spec/applications/main/rails_3-2-13/app/controllers/galaxies_controller.rb
tabulous-2.1.2 spec/applications/bootstrap/rails_3-2-13/app/controllers/galaxies_controller.rb
tabulous-2.1.1 spec/applications/custom_renderer/rails_3-2-13/app/controllers/galaxies_controller.rb
tabulous-2.1.1 spec/applications/bootstrap/rails_3-2-13/app/controllers/galaxies_controller.rb
tabulous-2.1.1 spec/applications/main/rails_3-2-13/app/controllers/galaxies_controller.rb
tabulous-2.1.1 spec/applications/simple_tabs/rails_3-2-13/app/controllers/galaxies_controller.rb
tabulous-2.1.0 spec/applications/bootstrap/rails_3-2-13/app/controllers/galaxies_controller.rb
tabulous-2.1.0 spec/applications/simple_tabs/rails_3-2-13/app/controllers/galaxies_controller.rb
tabulous-2.1.0 spec/applications/main/rails_3-2-13/app/controllers/galaxies_controller.rb
tabulous-2.1.0 spec/applications/custom_renderer/rails_3-2-13/app/controllers/galaxies_controller.rb
tabulous-2.0.0 spec/applications/bootstrap/rails_3-2-13/app/controllers/galaxies_controller.rb
tabulous-2.0.0 spec/applications/simple_tabs/rails_3-2-13/app/controllers/galaxies_controller.rb
tabulous-2.0.0 spec/applications/main/rails_3-2-13/app/controllers/galaxies_controller.rb
tabulous-2.0.0 spec/applications/custom_renderer/rails_3-2-13/app/controllers/galaxies_controller.rb