开发者

Question about Rails, Haml, and Forms

  .section
  .title
    Subscription

  .body
    = form_tag(:action => subscribe_url, :method => :post)
      = @plans.each do |p|
        %tr= p[:blurb]
        %tr= p[:price]
      .spacer
      = submit_tag( 'Subscribe', :class => 'button ok' )

    %p
    %br
    Note: If you wish to cancel your subscription, please
    -# link_to  "contact Customer Support", "http://su开发者_如何学JAVApport.jobfully.com"

The error we're seeing is this: /home/mei/Jobfully/app/views/subscriptions/list.html.haml:21: syntax error, unexpected keyword_ensure, expecting $end

Extracted source (around line #21):

18: %br 19: Note: If you wish to cancel your subscription, please 20: -# link_to "contact Customer Support", "http://support.jobfully.com"

Any suggestions about what we're doing wrong hereenter code here would be much appreciated. Thanks!


I don't know if it's directly related but form_tag should be

- form_tag(:action => subscribe_url, :method => :post) do

and your each loop should be

- @plans.each do |p|

There's a lot of, what I would call, 'weirdness' going on in the haml you've posted above. By this, I really mean that you have tags that will just be completely empty, such as .section and %p since there is nothing nested underneath them. I would try cutting out as much as you can and start rebuilding the haml file piece by piece.


Try this

%br
%p
  Note: If you wish to cancel your subscription, please
  = link_to  "contact Customer Support", "http://support.jobfully.com"
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜