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