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.pre42 app/controllers/patron_relationships_controller.rb
enju_biblio-0.1.0.pre41 app/controllers/patron_relationships_controller.rb
enju_biblio-0.1.0.pre40 app/controllers/patron_relationships_controller.rb
enju_biblio-0.1.0.pre39 app/controllers/patron_relationships_controller.rb
enju_biblio-0.1.0.pre38 app/controllers/patron_relationships_controller.rb
enju_biblio-0.1.0.pre37 app/controllers/patron_relationships_controller.rb
enju_biblio-0.1.0.pre36 app/controllers/patron_relationships_controller.rb
enju_biblio-0.1.0.pre35 app/controllers/patron_relationships_controller.rb
enju_biblio-0.1.0.pre34 app/controllers/patron_relationships_controller.rb
enju_biblio-0.1.0.pre33 app/controllers/patron_relationships_controller.rb
enju_biblio-0.1.0.pre32 app/controllers/patron_relationships_controller.rb
enju_biblio-0.1.0.pre31 app/controllers/patron_relationships_controller.rb
enju_biblio-0.1.0.pre30 app/controllers/patron_relationships_controller.rb
enju_biblio-0.1.0.pre29 app/controllers/patron_relationships_controller.rb
enju_biblio-0.1.0.pre28 app/controllers/patron_relationships_controller.rb
enju_biblio-0.1.0.pre27 app/controllers/patron_relationships_controller.rb
enju_biblio-0.1.0.pre26 app/controllers/patron_relationships_controller.rb
enju_biblio-0.1.0.pre25 app/controllers/patron_relationships_controller.rb
enju_biblio-0.1.0.pre24 app/controllers/patron_relationships_controller.rb
enju_biblio-0.1.0.pre23 app/controllers/patron_relationships_controller.rb