0
折りたたみ可能なGropを作成するヘルパーを作成しようとしています。 は私がヘルパーRuby with HTMLタグ
def faqbox(question, answer, number)
open :div, :class => "panel panel-default" do
open :div, :class => "panel-heading", :role => "tab", :id => "heading#{number}" do
open :h4, :class => "panel-title" do
open :a, :role => "button", :data-toggle => "collapse", :data-parent => "#accordion", :href => "#collapseOne", :aria-expanded => "true", :aria-controls => "collapse#{number}" do
"#{question}"
end
end
end
end
open :div, :id => "collapse#{number}", :class => "panel-collapse collapse in", :role => "tabpanel", :aria-labelledby => "heading#{number}" do
open :div, :class => "panel-body" do
"#{answer}"
end
end
end
に
<div class="panel panel-default">
<div class="panel-heading" role="tab" id="headingOne">
<h4 class="panel-title">
<a role="button" data-toggle="collapse" data-parent="#accordion" href="#collapseOne" aria-expanded="true" aria-controls="collapseOne">
Collapsible Group Item #1
</a>
</h4>
</div>
<div id="collapseOne" class="panel-collapse collapse in" role="tabpanel" aria-labelledby="headingOne">
<div class="panel-body">
text to answer
</div>
</div>
を変換しかし、私が使用している
それは "/乗車ヘルプ 文字列への記号の無い暗黙的な変換ではTypeErrorを" 私を与えます仲買人とルビー。私は何をしますか?