EastsideDev
EastsideDev

Reputation: 6639

Rails app crashes when I add a method to a helper file even though method is not called

I am working on an application, and have run into some issues.

In my stripe_payments_helper.rb, I have the following:

  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   

and hit the app url, I get the Internal Server Error message. The Stripe Payment page is not my home page. Any ideas?

Upvotes: 0

Views: 25

Answers (1)

Eyeslandic
Eyeslandic

Reputation: 14900

There is a syntax error there on this line

:events_history => events_history_for_spouse (params)

should be

:events_history => events_history_for_spouse(params)

Upvotes: 1

Related Questions