Sha256: 5353d2cdcf41c3096554da63a3d385c7caac20b6ce7f3da07116922914f534f6

Contents?: true

Size: 581 Bytes

Versions: 16

Compression:

Stored size: 581 Bytes

Contents

class ArtistsController < ApplicationController
  before_filter :load_artist, :only => [:edit, :update, :destroy]

  def index
    @artists = Artist.all
  end

  def new
    @artist = Artist.new
  end

  def create
    @artist = Artist.new(params[:artist])
    @artist.save

    redirect_to edit_artist_path(@artist)
  end

  def update
    @artist.update_attributes(params[:artist])
    redirect_to edit_artist_path(@artist)
  end

  def destroy
    @artist.destroy
    redirect_to artists_path
  end

  private

  def load_artist
    @artist = Artist.find(params[:id])
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
attachment_magick-0.3.6 test/dummy/app/controllers/artists_controller.rb
attachment_magick-0.3.5 test/dummy/app/controllers/artists_controller.rb
attachment_magick-0.3.4 test/dummy/app/controllers/artists_controller.rb
attachment_magick-0.3.3 test/dummy/app/controllers/artists_controller.rb
attachment_magick-0.3.2 test/dummy/app/controllers/artists_controller.rb
attachment_magick-0.3.1 test/dummy/app/controllers/artists_controller.rb
attachment_magick-0.3 test/dummy/app/controllers/artists_controller.rb
attachment_magick-0.2.7 test/dummy/app/controllers/artists_controller.rb
attachment_magick-0.2.6 test/dummy/app/controllers/artists_controller.rb
attachment_magick-0.2.5 test/dummy/app/controllers/artists_controller.rb
attachment_magick-0.2.4 test/dummy/app/controllers/artists_controller.rb
attachment_magick-0.2.3 test/dummy/app/controllers/artists_controller.rb
attachment_magick-0.2.2 test/dummy/app/controllers/artists_controller.rb
attachment_magick-0.2.1 test/dummy/app/controllers/artists_controller.rb
attachment_magick-0.2.0 test/dummy/app/controllers/artists_controller.rb
attachment_magick-0.1.0 test/dummy/app/controllers/artists_controller.rb