Sha256: 4e9374c8c80a454cc13461ee9338d5a9bddb23cf8f62332b38ef82768422b28a

Contents?: true

Size: 725 Bytes

Versions: 18

Compression:

Stored size: 725 Bytes

Contents

module Effective
  class SubscripterController < ApplicationController
    layout (EffectiveOrders.layout.kind_of?(Hash) ? EffectiveOrders.layout[:subscriptions] : EffectiveOrders.layout)

    include Effective::CrudController

    submit :save, 'Save', redirect: :back, success: -> { 'Successfully updated plan.' }

    def resource
      @subscripter ||= Effective::Subscripter.new(user: current_user)
    end

    # I don't want save_resource to wrap my save in a transaction
    def save_resource(resource, action, to_assign)
      resource.assign_attributes(to_assign)
      resource.save!
    end

    # StrongParameters
    def subscripter_params
      params.require(:effective_subscripter).permit!
    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
effective_orders-4.0.4 app/controllers/effective/subscripter_controller.rb
effective_orders-4.0.3 app/controllers/effective/subscripter_controller.rb
effective_orders-4.0.2 app/controllers/effective/subscripter_controller.rb
effective_orders-4.0.1 app/controllers/effective/subscripter_controller.rb
effective_orders-4.0.0 app/controllers/effective/subscripter_controller.rb
effective_orders-4.0.0beta19 app/controllers/effective/subscripter_controller.rb
effective_orders-4.0.0beta18 app/controllers/effective/subscripter_controller.rb
effective_orders-4.0.0beta17 app/controllers/effective/subscripter_controller.rb
effective_orders-4.0.0beta16 app/controllers/effective/subscripter_controller.rb
effective_orders-4.0.0beta15 app/controllers/effective/subscripter_controller.rb
effective_orders-4.0.0beta14 app/controllers/effective/subscripter_controller.rb
effective_orders-4.0.0beta13 app/controllers/effective/subscripter_controller.rb
effective_orders-4.0.0beta12 app/controllers/effective/subscripter_controller.rb
effective_orders-4.0.0beta11 app/controllers/effective/subscripter_controller.rb
effective_orders-4.0.0beta10 app/controllers/effective/subscripter_controller.rb
effective_orders-4.0.0beta9 app/controllers/effective/subscripter_controller.rb
effective_orders-4.0.0beta8 app/controllers/effective/subscripter_controller.rb
effective_orders-4.0.0beta7 app/controllers/effective/subscripter_controller.rb