0

I'm trying to implement a way for stripe to change subscriptions. I'm getting a little confused with my code. Currently i have the following:

Subscription_controller

def changeSubscription
    @user = User.find(params[:id])
    @plan = params[:type]
    c = Stripe::Customer.retrieve(@user.stripeCustomerId)
    c.update_subscription(:plan => @plan, :prorate => true)
  end

routes.rb

post 'subscribe/change/:type' => 'subscribe#changeSubscription'

and in my edit view i have this psuedocode i'd like help with getting working

  <div class="form-group">
    <%= collection_select(drop_down_of_subscription_types) %>
    <%= link_to "post request to 'subscribe#changeSubscription' with type sent" %>
  </div>

1 Answers1

0

Use submit_tag to render a submit button for a form.

link_to and button_to will not work.

Substantial
  • 6,684
  • 2
  • 31
  • 40