Brand newy here - according to the docs I can do a combo ruby + static
text, but I don't get it :(
So how would I change the following HAML
.car_module
%span.car_name= car.name
%span.rrp
RRP
= number_to_currency(car.new_price, :precision => 0)
%span.term
= car.residual.num_years
years
%ul.finance_options
[EMAIL PROTECTED] do |lease_type|
%li
%span.name= lease_type.name.titleize
%span.amount= number_to_currency car.rate(lease_type)
-end
The above currently results in the following
<div class='car_module'>
<span class='car_name'>VOLVO XC70</span>
<span class='rrp'>
RRP
$64,450
</span>
<span class='term'>
5
years
</span>
<ul class='finance_options'>
<li>
<span class='name'>Car Finance</span>
<span class='amount'>$883.15</span>
</li>
<li>
<span class='name'>Car Lease</span>
<span class='amount'>$879.02</span>
</li>
<li>
<span class='name'>Chattel Mortgage</span>
<span class='amount'>$874.88</span>
</li>
<li>
<span class='name'>Hire Purchase</span>
<span class='amount'>$791.59</span>
</li>
</ul>
</div>
While its completely valid there is a lot of extra white space and it
isn't as quick to read as the following
<div class='car_module'>
<span class='car_name'>VOLVO XC70</span>
<span class='rrp'>RRP $64,450</span>
<span class='term'>5 years</span>
<ul class='finance_options'>
<li><span class='name'>Car Finance</span><span class='amount'>
$883.15</span></li>
<li><span class='name'>Car Lease</span><span class='amount'>
$879.02</span></li>
<li><span class='name'>Chattel Mortgage</span><span class='amount'>
$874.88</span></li>
<li><span class='name'>Hire Purchase</span><span class='amount'>
$791.59</span></li>
</ul>
</div>
Which is what I'd like.
This HAML/SASS stuff is really great to work with too :)
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---