带下拉导轨的条带更改订阅

问题描述:

我试图实现条带更改订阅的方式。我对我的代码有些困惑。目前,我有以下几点:带下拉导轨的条带更改订阅

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' 

,并在我的编辑视图我有这样的伪码我想要得到的工作

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

您错过了一个表格(

我猜。 – techvineet

使用submit_tag呈现表单的提交按钮。

link_to and button_to will not working