Sha256: 94d7e85ce6d1f84091ff2939f5bc2e9aa2ab2acee38f98079fae50aebc53cf64

Contents?: true

Size: 695 Bytes

Versions: 16

Compression:

Stored size: 695 Bytes

Contents

class WorksController < ApplicationController
  before_filter :load_artist

  def index
    @works = @artist.works
  end

  def new
    @work = @artist.works.build
  end

  def edit
    @work = @artist.works.find(params[:id])
  end

  def create
    @work = @artist.works.create(params[:work])
    redirect_to edit_artist_work_path(@artist, @work)
  end

  def update
    @work = @artist.works.find(params[:id])
    @work.update_attributes(params[:work])
    redirect_to edit_artist_work_path(@artist, @work)
  end

  def destroy
    @artist.works.find(params[:id]).destroy
    redirect_to artists_path
  end

  private

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

Version data entries

16 entries across 16 versions & 1 rubygems

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