Sha256: fa18617d5d544d2d25ffd1c282f250934d1572856c57e98ad50c868a5adb2d68

Contents?: true

Size: 749 Bytes

Versions: 13

Compression:

Stored size: 749 Bytes

Contents

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

  def new
    @agent_relationship = AgentRelationship.new(params[:agent_relationship])
    @agent_relationship.parent = Agent.find(params[:agent_id]) rescue nil
    @agent_relationship.child = Agent.find(params[:child_id]) rescue nil
  end

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

  private
  def prepare_options
    @agent_relationship_types = AgentRelationshipType.all
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
enju_biblio-0.1.0.pre55 app/controllers/agent_relationships_controller.rb
enju_biblio-0.1.0.pre54 app/controllers/agent_relationships_controller.rb
enju_biblio-0.1.0.pre53 app/controllers/agent_relationships_controller.rb
enju_biblio-0.1.0.pre52 app/controllers/agent_relationships_controller.rb
enju_biblio-0.1.0.pre51 app/controllers/agent_relationships_controller.rb
enju_biblio-0.1.0.pre50 app/controllers/agent_relationships_controller.rb
enju_biblio-0.1.0.pre49 app/controllers/agent_relationships_controller.rb
enju_biblio-0.1.0.pre48 app/controllers/agent_relationships_controller.rb
enju_biblio-0.1.0.pre47 app/controllers/agent_relationships_controller.rb
enju_biblio-0.1.0.pre46 app/controllers/agent_relationships_controller.rb
enju_biblio-0.1.0.pre45 app/controllers/agent_relationships_controller.rb
enju_biblio-0.1.0.pre44 app/controllers/patron_relationships_controller.rb
enju_biblio-0.1.0.pre43 app/controllers/patron_relationships_controller.rb