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>