Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6620005
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T21:02:40+00:00 2026-05-25T21:02:40+00:00

My form seems to work perfectly fine locally, but gives me a syntax error

  • 0

My form seems to work perfectly fine locally, but gives me a syntax error on heroku. Here is my code thats causing the error:

<%= form_for (@item, {:url => [@company, @item]}) do |item_form| %>

The error is:

syntax error, unexpected ‘}’, expecting keyword_end
2011-09-24T22:25:25+00:00 app[web.1]: …e, {:url => [@company, @item]}) do |item_form| @output_buf…

Then when I tried

<%= form_for (@item, :url => [@company, @item]) do |item_form| %>

It gave me this error:

syntax error, unexpected ‘,’, expecting ‘)’
2011-09-24T22:18:01+00:00 app[web.1]: …ffer.append= form_for (@share, :url => [@company, @share])

Any ideas?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T21:02:40+00:00Added an answer on May 25, 2026 at 9:02 pm

    You should remove the space between the method call form_for and the opening parenthesis (. As a general rule, never do this. It’s ambiguous and may result in the parser thinking that you’re calling form_for with one argument, like this:

    <%= form_for((@item, :url => [@company, @item])) do |item_form| %>
    

    … which would be a syntax error, resulting in the errors you’re seeing (e.g. unexpected comma)

    # it should be:
    <%= form_for(@item, :url => [@company, @item]) do |item_form| %>
    
    # or, remove the parentheses altogether (up to your usage tastes):
    <%= form_for @item, :url => [@company, @item] do |item_form| %>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Everything seems to work fine until i want to submit the form and update
Notes: I'm still fairly new to php This login form seems to work perfectly
This seems like a must have form input for a mobile ui framework, but
ASP.NET MVC's Html.BeginForm() seems to work with jQuery validation plugin but the validation plugin
I've tried 3 different approaches, and nothing seems to work. Here's my view: def
I've written a simple contact form in my mvc3 app. Everything seems to work
Everything in my script so far seems to work perfect. But the data inserted
Now I'm trying to work with System.Web.Routing. All is just fine, but I can't
In my Flex application I need to authenticate to a j_security_check form (which seems
i've created a video upload form and it seems that i get a limit

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.