当我向辅助文件添加方法时,即使没有调用方法,Rails应用程序也会崩溃

时间:2014-05-21 22:28:13

标签: ruby-on-rails devise

我正在处理一个应用程序,并遇到了一些问题。

在我的stripe_payments_helper.rb中,我有以下内容:

  def add_spouse_as_a_user(params,user)
    if !params["spouse_first_name"] && !params["spouse_last_name"] && params["spouse_email"]
      return nil
    end
    if user_registered_for_event(params["spouse_email"])
      return TRUE
    end
    user_guest_name = "Guest of: #{user.first} #{user.last}"
    spouse = User.new(
        :id => ParnId.calculate(params["spouse_first_name"], params["spouse_last_name"]),
        :email => params["spouse_email"],
        :role => '["peer"]',
        :password =>'xxxxxxxxxx',
        :password_confirmation =>'xxxxxxxxxx',
        :first =>  params["spouse_first_name"],
        :last => params["spouse_last_name"],
        :bio => user_guest_name,
        :events_history => events_history_for_spouse (params)
    )
    spouse.save(:validate => false)
  end   

并点击应用网址,我收到内部服务器错误消息。 Stripe Payment页面不是我的主页。有什么想法吗?

1 个答案:

答案 0 :(得分:1)

此行存在语法错误

:events_history => events_history_for_spouse (params)

应该是

:events_history => events_history_for_spouse(params)