Sha256: 69ff20ebfbbce262f5d0e322ac8bfbcf753a04813f354fc8f9b469b634a9f22b

Contents?: true

Size: 763 Bytes

Versions: 40

Compression:

Stored size: 763 Bytes

Contents

class PatronRelationshipsController < InheritedResources::Base
  respond_to :html, :json
  has_scope :page, :default => 1
  load_and_authorize_resource
  before_filter :prepare_options, :except => [:index, :destroy]

  def new
    @patron_relationship = PatronRelationship.new(params[:patron_relationship])
    @patron_relationship.parent = Patron.find(params[:patron_id]) rescue nil
    @patron_relationship.child = Patron.find(params[:child_id]) rescue nil
  end

  def update
    @patron_relationship = PatronRelationship.find(params[:id])
    if params[:move]
      move_position(@patron_relationship, params[:move])
      return
    end
    update!
  end

  private
  def prepare_options
    @patron_relationship_types = PatronRelationshipType.all
  end
end

Version data entries

40 entries across 40 versions & 1 rubygems

Version Path
enju_biblio-0.1.0.pre22 app/controllers/patron_relationships_controller.rb
enju_biblio-0.1.0.pre21 app/controllers/patron_relationships_controller.rb
enju_biblio-0.1.0.pre20 app/controllers/patron_relationships_controller.rb
enju_biblio-0.1.0.pre19 app/controllers/patron_relationships_controller.rb
enju_biblio-0.1.0.pre18 app/controllers/patron_relationships_controller.rb
enju_biblio-0.1.0.pre17 app/controllers/patron_relationships_controller.rb
enju_biblio-0.1.0.pre16 app/controllers/patron_relationships_controller.rb
enju_biblio-0.1.0.pre15 app/controllers/patron_relationships_controller.rb
enju_biblio-0.1.0.pre14 app/controllers/patron_relationships_controller.rb
enju_biblio-0.1.0.pre13 app/controllers/patron_relationships_controller.rb
enju_biblio-0.1.0.pre12 app/controllers/patron_relationships_controller.rb
enju_biblio-0.1.0.pre11 app/controllers/patron_relationships_controller.rb
enju_biblio-0.1.0.pre10 app/controllers/patron_relationships_controller.rb
enju_biblio-0.1.0.pre9 app/controllers/patron_relationships_controller.rb
enju_biblio-0.1.0.pre8 app/controllers/patron_relationships_controller.rb
enju_biblio-0.1.0.pre7 app/controllers/patron_relationships_controller.rb
enju_biblio-0.1.0.pre6 app/controllers/patron_relationships_controller.rb
enju_biblio-0.1.0.pre5 app/controllers/patron_relationships_controller.rb
enju_biblio-0.1.0.pre4 app/controllers/patron_relationships_controller.rb
enju_biblio-0.1.0.pre3 app/controllers/patron_relationships_controller.rb