ruby on rails - erb to haml conversion to apply body class -


i have theses 2 line in erb

<body class="<%= yield (:body_class) %>"> <% content_for :body_class, "my_class" %> 

i have tried

- content_for :body_class   my_class 

for above haml conversion i'm not sure - correct or not ! , not able figure out haml conversion for

<body class="<%= yield (:body_class) %>"> 

any appreciated

you do:

%body{ class: "#{yield (:body_class)}" } 

and

- content_for :body_class     my_class 

Comments

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -