我想在link_to
语句中传递一个 div。这对我不起作用:
<%= link_to :controller => 'abouts', :action => 'index', :anchor => 'teacher-account' do %>
<div class="accordion-inner">
About Me
</div>
<%= end %>
我想在link_to
语句中传递一个 div。这对我不起作用:
<%= link_to :controller => 'abouts', :action => 'index', :anchor => 'teacher-account' do %>
<div class="accordion-inner">
About Me
</div>
<%= end %>
link_to
助手支持一些选项来传递和url
例如html
:link_to(body, url_options = {}, html_options = {})
.
所以你也许可以试试这个:
link_to('About me', { controller: 'abouts', action: 'index' }, anchor: 'teacher-account', class: "accordion-inner")