Sha256: e5b22a584520ae4126a20a9a8b9916383ac671db79be2586ecf3dce02a47a810

Contents?: true

Size: 1.94 KB

Versions: 14

Compression:

Stored size: 1.94 KB

Contents

class DatasetsController < ApplicationController
  # GET /datasets
  # GET /datasets.json
  def index
    @datasets = Dataset.all

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

  # GET /datasets/1
  # GET /datasets/1.json
  def show
    @dataset = Dataset.find(params[:id])

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

  # GET /datasets/new
  # GET /datasets/new.json
  def new
    @dataset = Dataset.new

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

  # GET /datasets/1/edit
  def edit
    @dataset = Dataset.find(params[:id])
  end

  # POST /datasets
  # POST /datasets.json
  def create
    @dataset = Dataset.new(params[:dataset])
    respond_to do |format|
      if @dataset.save
        format.html { redirect_to @dataset, notice: 'Dataset was successfully created.' }
        format.json { render json: @dataset, status: :created, location: @dataset }
      else
        format.html { render action: "new" }
        format.json { render json: @dataset.errors, status: :unprocessable_entity }
      end
    end
  end

  # PUT /datasets/1
  # PUT /datasets/1.json
  def update
    @dataset = Dataset.find(params[:id])

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

  # DELETE /datasets/1
  # DELETE /datasets/1.json
  def destroy
    @dataset = Dataset.find(params[:id])
    @dataset.destroy

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

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
hydra-tutorial-0.2.1 old_tutorial/templates/application/datasets_controller.rb
hydra-tutorial-0.2.0 old_tutorial/templates/application/datasets_controller.rb
hydra-tutorial-0.1.3 templates/application/datasets_controller.rb
hydra-tutorial-0.1.2 templates/application/datasets_controller.rb
hydra-tutorial-0.1.0 templates/application/datasets_controller.rb
hydra-tutorial-0.0.9 templates/application/datasets_controller.rb
hydra-tutorial-0.0.8 templates/application/datasets_controller.rb
hydra-tutorial-0.0.7 templates/application/datasets_controller.rb
hydra-tutorial-0.0.6 templates/application/datasets_controller.rb
hydra-tutorial-0.0.5 templates/application/datasets_controller.rb
hydra-tutorial-0.0.4 templates/application/datasets_controller.rb
hydra-tutorial-0.0.3 templates/application/datasets_controller.rb
hydra-tutorial-0.0.2 templates/application/datasets_controller.rb
hydra-tutorial-0.0.1 templates/application/datasets_controller.rb