def update
      @subscription.end_trial_now = (params[:subscription][:end_trial_now] == '1')
      if @subscription.end_trial_now
        params[:subscription]['trial_end(1i)'] = ''
        params[:subscription]['trial_end(2i)'] = ''
        params[:subscription]['trial_end(3i)'] = ''
      end

      if @subscription.update(subscription_params)
        redirect_to [:admin, @subscription], notice: 'Subscription was successfully updated.'
      else
        render :edit
      end
    end
def update
      @subscription.end_trial_now = (params[:subscription][:end_trial_now] == '1')
      if @subscription.end_trial_now
        params[:subscription]['trial_end(1i)'] = ''
        params[:subscription]['trial_end(2i)'] = ''
        params[:subscription]['trial_end(3i)'] = ''
      end

      if @subscription.update(subscription_params)
        redirect_to [:admin, @subscription], notice: 'Subscription was successfully updated.'
      else
        render :edit
      end
    end
PATCH/PUT /subscriptions/1