Sha256: 5b2835b2c29670782fe60ac845967a5c1923c28cd36393ec0bbd605d3959e742

Contents?: true

Size: 524 Bytes

Versions: 15

Compression:

Stored size: 524 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

15 entries across 15 versions & 1 rubygems

Version Path
roar-0.11.4 test/dummy/app/controllers/albums_controller.rb
roar-0.11.3 test/dummy/app/controllers/albums_controller.rb
roar-0.11.2 test/dummy/app/controllers/albums_controller.rb
roar-0.11.1 test/dummy/app/controllers/albums_controller.rb
roar-0.11.0 test/dummy/app/controllers/albums_controller.rb
roar-0.10.2 test/dummy/app/controllers/albums_controller.rb
roar-0.10.1 test/dummy/app/controllers/albums_controller.rb
roar-0.10.0 test/dummy/app/controllers/albums_controller.rb
roar-0.9.2 test/dummy/app/controllers/albums_controller.rb
roar-0.9.1 test/dummy/app/controllers/albums_controller.rb
roar-0.9.0 test/dummy/app/controllers/albums_controller.rb
roar-0.8.3 test/dummy/app/controllers/albums_controller.rb
roar-0.8.2 test/dummy/app/controllers/albums_controller.rb
roar-0.8.1 test/dummy/app/controllers/albums_controller.rb
roar-0.8.0 test/dummy/app/controllers/albums_controller.rb