To ensure proper continuity and reference point for others. ---- Copy from email ---- The problem here is how you're using the form_tag syntax. There are two ways to use the helper: you can feed it a block and let it print everything to output on its own, or you can not feed it a block and print the result yourself, which will just output the beginning <form> tag. (...snip...) Because you're indenting the contents, Haml thinks you want to do a Ruby block, so it puts an "end" at the end of it. However, this results in something like
form_tag(...) bunch_of_tags end Which, of course, throws an error, because there's an "end" without a "do". The way to get around this is to use, instead of = form_tag(...) stuff either = form_tag(...) stuff = end_form tag or the nicer-looking - form_tag(...) do stuff ~~~~~~~~ My error was that I had an indent between =form_tag(...) and = end_form_tag Thanks a lot Nathan On Feb 19, 5:15 pm, "kleinman" <[EMAIL PROTECTED]> wrote: > Nathan: I understand that the error will not be there in Rails since > that helper > method will be resolved correctly. > > However that does not help me in discovering errors further down the > Haml file... > After removing the partials, I'm getting this: > (haml):39: (eval):128:in `compile': compile error (SyntaxError) > (eval):128: parse error, unexpected kEND, expecting $ from ./vendor/ > plugins/haml/bin/../lib/haml/engine.rb:393:in `compile' > from ./vendor/plugins/haml/bin/../lib/haml/engine.rb:190:in > `to_html' > from ./vendor/plugins/haml/bin/../lib/haml/exec.rb:150:in > `process_result' > from ./vendor/plugins/haml/bin/../lib/haml/exec.rb:22:in > `parse!' > from ./vendor/plugins/haml/bin/haml:8 > > The haml file is in your inbox. > Martin > > On Feb 19, 4:43 pm, Nathan Weizenbaum <[EMAIL PROTECTED]> wrote: > > > Martin, your image_tag issue is exactly what the error says: image_tag > > is undefined. It's an ActionView helper, and so only exists when Haml is > > using an ActionView::Base as its rendering context. This happens > > automatically in Rails, but it's not done for the executable. > > > I'm not sure what's up with form_tag... can I see an example of code > > that fails silently with Haml 1.4.0? > > > - Nathan > > > kleinman wrote: > > > Hey Hampton: > > > > I'm having the same type of issues here, where a form_tag is > > > generating a blank page without any explanations. > > > I've updated to version 1.4.0 but I still do not see any meaningful > > > errors. > > > > When I tried the standalone parser, I get this: > > > ---- > > > macximus% ./vendor/plugins/haml/bin/haml --stdout app/views/profile/ > > > mobile.haml > > > (haml):2: undefined method `image_tag' for #<Object:0x6e9360> > > > (NoMethodError) > > > from (eval):8:in `_haml_render' > > > from ./vendor/plugins/haml/bin/../lib/haml/engine.rb:394:in > > > `compile' > > > from ./vendor/plugins/haml/bin/../lib/haml/engine.rb:190:in > > > `to_html' > > > from ./vendor/plugins/haml/bin/../lib/haml/exec.rb:150:in > > > `process_result' > > > from ./vendor/plugins/haml/bin/../lib/haml/exec.rb:22:in > > > `parse!' > > > from ./vendor/plugins/haml/bin/haml:8 > > > ---- > > > > But this error will not be there when executed within Rails. > > > > What setup to I need to do to remove this error or better yet any way > > > to > > > enable haml debugging mode in a view. > > > > Thanks - Martin --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Haml" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/haml?hl=en -~----------~----~----~----~------~----~------~--~---
