Sha256: b70767d1a78a97a5fa6a542f2b64865b59e38bb52851239ae5e90777bb048263

Contents?: true

Size: 879 Bytes

Versions: 1

Compression:

Stored size: 879 Bytes

Contents

module MessageTrain
  class BoxesController < MessageTrain::ApplicationController
    before_filter :load_conversations

    # GET /box/:division
    def show
      @conversations = @conversations.page(params[:page])
      render :show
    end

    # PATCH/PUT /box/:division
    def update
      if params[:mark_to_set].present? && @objects.present?
        @box.mark(params[:mark_to_set], @objects)
      end
      respond_to_marking
    end

    # DELETE /box/:division
    def destroy
      if ['ignore', 'unignore'].include? params[:mark_to_set]
        @box.send(params[:mark_to_set], @objects)
      end
      respond_to_marking
    end

    private

      def load_conversations
        @conversations = @box.conversations
      end

      def load_box
        @box = send(MessageTrain.configuration.current_user_method).box(params[:division].to_sym)
      end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
message_train-0.1.7 app/controllers/message_train/boxes_controller.rb