Sha256: 11eaa159a3bf4005132411e0d3c89ecf33407b63a458c54416d5b3b5574b2e29

Contents?: true

Size: 596 Bytes

Versions: 7

Compression:

Stored size: 596 Bytes

Contents

module Dorsale
  module SmallData
    class FiltersController < ::Dorsale::ApplicationController

      def create
        new_filters = params[:filters] || {}

        new_filters.each do |key, value|
          new_filters[key] = "" if value == "0"
        end

        filters = Filter.new(cookies)
        new_filters = filters.read.merge(new_filters)
        filters.store(new_filters)

        urls = [
          params[:back_url],
          request.referer,
          (main_app.root_path rescue nil)
        ]

        redirect_to urls.select(&:present?).first
      end

    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
dorsale-1.2.6 app/controllers/dorsale/small_data/filters_controller.rb
dorsale-1.2.5 app/controllers/dorsale/small_data/filters_controller.rb
dorsale-1.2.4 app/controllers/dorsale/small_data/filters_controller.rb
dorsale-1.2.3 app/controllers/dorsale/small_data/filters_controller.rb
dorsale-1.2.2 app/controllers/dorsale/small_data/filters_controller.rb
dorsale-1.2.1 app/controllers/dorsale/small_data/filters_controller.rb
dorsale-1.2.0 app/controllers/dorsale/small_data/filters_controller.rb