For the first time I use Slim . And immediately poser. How to write such code in Slim?

 <li><%= current_user.name%> <%= current_user.last_name.first.capitalize%></li><br /> 

    1 answer 1

    In Slim, you can interpol string with #{}

    That is, it will be like this:

     li= "#{current_user.name} #{current_user.last_name.first.capitalize}" br/ 

    Or so:

     li | #{current_user.name} #{current_user.last_name.first.capitalize} br/ 

    PS In general, it is better to use a decorator to display all sorts of full names, as you often have to copy #{current_user.name} #{current_user.last_name.first.capitalize}

    • Thank! works, and I will consider the decorator :)) - Mike Yusko