ruby-on-railsslim-lang

how to give whitespace in ruby slim


I want to seperate currency and total with whitespace.

Please suggest me a solution Any help would be appreciated.

p
strong Total:
span
    = @order.currency
    = humanized_money_with_symbol @order.total_paisas/100

Solution

  • You can solve this with string interpolation, by doing something like this:

    p
    strong Total:
    span
        = "#{@order.currency} #{humanized_money_with_symbol @order.total_paisas/100}"
    

    Or with a non-breaking space (nbsp) like this:

    p
    strong Total:
    span
        = @order.currency
        |  
        = humanized_money_with_symbol @order.total_paisas/100