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