Sha256: 49d3fd0a79beda5f1c747f4f0800f7ca121b86e63c266a4242872b7e08227691

Contents?: true

Size: 1.17 KB

Versions: 12

Compression:

Stored size: 1.17 KB

Contents

module Abstractor
  module Methods
    module Controllers
      module AbstractorSuggestionsController
        def self.included(base)
          base.send :before_filter, :set_abstractor_suggestion, :only => [:update]
        end

        def update
          respond_to do |format|
            if @abstractor_suggestion.update_attributes(abstractor_suggestion_params)
              format.html { redirect_to(abstractor_abstraction_path(@abstractor_abstraction)) }
            else
              format.html { render "abstractor_abstractions/show" }
            end
          end
        end

        private
          def set_abstractor_suggestion
            @abstractor_abstraction = Abstractor::AbstractorAbstraction.find(params[:abstractor_abstraction_id])
            @abstractor_suggestion = Abstractor::AbstractorSuggestion.find(params[:id])
            @about = @abstractor_abstraction.about
          end

          def abstractor_suggestion_params
            params.require(:abstractor_suggestion).permit(:id, :abstractor_abstraction_id, :abstractor_suggestion_status_id, :suggested_value, :unknown, :not_applicable, :deleted_at, :_destroy)
          end
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
abstractor-4.2.2 lib/abstractor/methods/controllers/abstractor_suggestions_controller.rb
abstractor-4.2.1 lib/abstractor/methods/controllers/abstractor_suggestions_controller.rb
abstractor-4.2.0 lib/abstractor/methods/controllers/abstractor_suggestions_controller.rb
abstractor-4.1.5 lib/abstractor/methods/controllers/abstractor_suggestions_controller.rb
abstractor-4.1.4 lib/abstractor/methods/controllers/abstractor_suggestions_controller.rb
abstractor-4.1.3 lib/abstractor/methods/controllers/abstractor_suggestions_controller.rb
abstractor-4.1.2 lib/abstractor/methods/controllers/abstractor_suggestions_controller.rb
abstractor-4.1.1 lib/abstractor/methods/controllers/abstractor_suggestions_controller.rb
abstractor-4.1.0 lib/abstractor/methods/controllers/abstractor_suggestions_controller.rb
abstractor-4.0.2 lib/abstractor/methods/controllers/abstractor_suggestions_controller.rb
abstractor-4.0.1 lib/abstractor/methods/controllers/abstractor_suggestions_controller.rb
abstractor-4.0.0 lib/abstractor/methods/controllers/abstractor_suggestions_controller.rb