Please post the code somewhere where the indentation doesn't get mangled (that is, not via email).
On Sun, May 22, 2011 at 8:39 PM, Anoop Ranganath <an...@ranganath.com>wrote: > I am using a form_for which works wonderfully in the development > environment. The code around it looks like this: > > - if user_signed_in? > Welcome, #{link_to current_user.first_name, user_path(current_user)} > = link_to "Sign out", logout_path > - elsif > = form_for :user, :url => login_path do |f| > = f.label :email > = f.text_field :email > %br > = f.label :password > = f.password_field :password > %br > = submit_tag 'Log in' > > It's fairly straightforward. This code works perfectly in development, but > when run in the staging environment, I get a syntax error: > > syntax error, unexpected tSYMBEG, expecting keyword_do or '{' or '(' > haml_temp = form_for :user, :url => login_path do |f| > > The error is happening at the :user symbol. Here's the weird thing. If I > add in a throwaway line before the form_for, this code works perfectly. In > this case, I add "= nil". The code looks like this and everything works: > > - if user_signed_in? > Welcome, #{link_to current_user.first_name, user_path(current_user)} > = link_to "Sign out", logout_path > - elsif > = nil > = form_for :user, :url => login_path do |f| > = f.label :email > = f.text_field :email > %br > = f.label :password > = f.password_field :password > %br > = submit_tag 'Log in' > > > Any ideas what I might be doing wrong? > > Thanks! > Anoop > > > > -- > You received this message because you are subscribed to the Google Groups > "Haml" group. > To post to this group, send email to haml@googlegroups.com. > To unsubscribe from this group, send email to > haml+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/haml?hl=en. > > -- You received this message because you are subscribed to the Google Groups "Haml" group. To post to this group, send email to haml@googlegroups.com. To unsubscribe from this group, send email to haml+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/haml?hl=en.