Sha256: d6a2d8b01f6186d685839b00993b7488c60c57924fe1e936b32ae06d2a667870

Contents?: true

Size: 508 Bytes

Versions: 3

Compression:

Stored size: 508 Bytes

Contents

require 'roar/rails'

class AlbumsController < ActionController::Base
  include Roar::Rails::ControllerMethods

  respond_to :xml
  represents Album

  def show
    @album = Album.find(params[:id])
    respond_with @album
  end

  def create
    @album = Album.create(representation)

    respond_with @album
  end

  def update
    @album = Album.find(params[:id])
    @album.songs.delete_all # make PUT behave REST-compliant.
    @album.update_attributes(representation)

    respond_with @album
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
roar-0.11.7 test/dummy/app/controllers/albums_controller.rb
roar-0.11.6 test/dummy/app/controllers/albums_controller.rb
roar-0.11.5 test/dummy/app/controllers/albums_controller.rb