Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to debug view in rails slim framework

I want to debug my view in rails slim framework.

In my html.erb file i can do this

<%= debug @current_user %>

How do i do this in rails html.slim file?

i tried doing

- if current_user.has_role?(:student) || current_user.has_role?(:teacher)
    .home-header-box.center
        h3.welcome-header-title
            LP Welcome to TeachForMe

debug current_user

but it isnt working.

Any help appreciated

like image 899
Kingsley Simon Avatar asked Feb 19 '26 02:02

Kingsley Simon


1 Answers

To run Ruby code in Slim template you just need to use = sign

= debug @current_user

like image 194
Igor Springer Avatar answered Feb 22 '26 02:02

Igor Springer



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!