Sha256: b10f3def2af9da6f89adb9dcc20d55e7ffcca36845bb458559dee243e2672dab

Contents?: true

Size: 783 Bytes

Versions: 6

Compression:

Stored size: 783 Bytes

Contents

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

  def new
    @manifestation_relationship = ManifestationRelationship.new(params[:manifestation_relationship])
    @manifestation_relationship.parent = Manifestation.find(params[:manifestation_id]) rescue nil
    @manifestation_relationship.child = Manifestation.find(params[:child_id]) rescue nil
  end

  def update
    if params[:move]
      move_position(@manifestation_relationship, params[:move])
      return
    end
    update!
  end

  private
  def prepare_options
    @manifestation_relationship_types = ManifestationRelationshipType.all
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
enju_biblio-0.1.0.pre55 app/controllers/manifestation_relationships_controller.rb
enju_biblio-0.1.0.pre54 app/controllers/manifestation_relationships_controller.rb
enju_biblio-0.1.0.pre53 app/controllers/manifestation_relationships_controller.rb
enju_biblio-0.1.0.pre52 app/controllers/manifestation_relationships_controller.rb
enju_biblio-0.1.0.pre51 app/controllers/manifestation_relationships_controller.rb
enju_biblio-0.1.0.pre50 app/controllers/manifestation_relationships_controller.rb