【问题标题】:Stripe change subscription with dropdown rails带下拉栏的条带更改订阅
【发布时间】: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


【解决方案1】:

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

link_tobutton_to不起作用

【讨论】:

    猜你喜欢
    • 2018-09-20
    • 1970-01-01
    • 2021-05-30
    • 2015-02-20
    • 2021-01-22
    • 2018-11-29
    • 2020-01-16
    • 2020-11-14
    • 1970-01-01
    相关资源
    最近更新 更多