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?
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".
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.