Sha256: d4981e190ed3570fb983b12479aef82b3b4efabbaa7397206c0b093a39c2caf7

Contents?: true

Size: 652 Bytes

Versions: 9

Compression:

Stored size: 652 Bytes

Contents

module Newsletter 
  class AreasController < ::Newsletter::ApplicationController
    
    before_filter :find_area, :except => [:create, :new, :index]
    before_filter :find_design, :except => [:destroy,:sort]
  
    def sort
      @newsletter = Newsletter.find(params[:newsletter_id])
      @area.pieces.active.by_newsletter(@newsletter).each do | piece |
        piece.update_attribute(:sequence, params["piece"].index(piece.id.to_s).to_i+1)
      end
      head :ok
    end
  
    protected
  
    def find_design
      @design = Design.find(params[:design_id])
    end
    
    def find_area
      @area = Area.find(params[:id])
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
newsletter-3.2.25.1 app/controllers/newsletter/areas_controller.rb
newsletter-3.2.22.0 app/controllers/newsletter/areas_controller.rb
newsletter-3.2.7 app/controllers/newsletter/areas_controller.rb
newsletter-3.2.6 app/controllers/newsletter/areas_controller.rb
newsletter-3.2.5 app/controllers/newsletter/areas_controller.rb
newsletter-3.2.4 app/controllers/newsletter/areas_controller.rb
newsletter-3.2.2 app/controllers/newsletter/areas_controller.rb
newsletter-3.2.1 app/controllers/newsletter/areas_controller.rb
newsletter-3.2.0 app/controllers/newsletter/areas_controller.rb