0

I am pretty new to web-design and working on some code that part of it is like this:

  .row-fluid
    - if(params[:offset].to_i>0)
      = link_to t('.previous'), reports_path(offset: give_previous_page(@offset, @limit)),
        { class: 'btn btn-small btn-primary'}
    - else

some of the things I understand so far, for example Ok this is a Rail code, instead of ERB we have used HAML syntax and there some twitter bootstrap classes like those .row-fluid and btn-primary in it too, but the part that I don' understand is that "-" that we see next to the lines with "if" an "else" . What are those and what do they do?

1 Answer 1

8

In HAML under Rails, - means "this line is Ruby code; don't output its value".

By contrast = means "this line is Ruby code; output its value".

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.