Ask A Question

Notifications

You’re not receiving notifications from this thread.

How do I resolve this syntax error

Jim Miller asked in Rails

Hi guys,

I have this error and I don't understand what the error is. I'm using Rails 6

syntax error, unexpected tLABEL
stripe_id: customer.id,
~~~~~~~~~
/vagrant/Rails/stripe-test/app/controllers/subscriptions_controller.rb:34: syntax error, unexpected tLABEL, expecting '='

My code is:
options = (
stripe_id: customer.id,
stripe_subscription_id: subscription.id
)

current_user.update(options)

Thanks,
Jim

Reply

Presumably you meant options to be a hash? You used () instead of {}

options = {
  stripe_id: customer.id,
  stripe_subscription_id: subscription.id
}
Reply

That's it! Thanks!

Reply
Join the discussion
Create an account Log in

Want to stay up-to-date with Ruby on Rails?

Join 87,563+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.