I know this post here:
Ruby Slim - How do you define an element class using a helper or the rails variable?
and I tried all three solutions. For me, unfortunately, none of them work.
forum.rb
.panel .panel-heading .span = @forum.name .panel-body .row .col-md-7
forum_feed.js.coffee
window.ForumFeedUI = flight.component -> @defaultAttrs titleSelector: '.value.volume' topicSelector: '.value.topic' dateSelector: '.value.date' @refresh = (event, data) -> @update @select('volumSelector'), data.volume @update @select('topicSelector'), data.topic @update @select('dateSelector'), data.date
Everything works as expected when I want to print variables as text on a website. However, I need divs that also contain a variable for the name. No matter what I try, I cannot get the divs class with a header variable.
I believe that I need to create a helper element in these lines and content_tag:
content_tag(:div, content_tag(:p, "Hello world!"), class: "strong") div = t(".#{forum_title title}") def forum_title(title, &block) content_tag :div, class: "col-md-3-#{title}" do capture(&block) end end
source share