【发布时间】:2014-02-14 18:08:39
【问题描述】:
我正在尝试实现条带更改订阅的方法。我对我的代码有点困惑。目前我有以下内容:
订阅控制器
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>
【问题讨论】:
-
你缺少一个表单( 我猜。
标签: ruby-on-rails stripe-payments subscriptions