ruby on rails - link_to block not working -


i'm using series of link_to blocks create buttons in application. i'm finding these links don't end working. mouse-over button, recognizes link, correct url displays in lower left-hand corner in firefox, when click, nothing happens. nothing comes in terminal or development log either.

my code follows:

<%= link_to new_folder_path do%>     <div class="btn btn-default add-button add_fields"><span class="glyphicon glyphicon-plus"></span>add folder</div> <% end %> 

this renders following html:

<li>   <a href="/folders/new">     <div class="btn btn-default add-button add_fields"><span class="glyphicon glyphicon-plus"></span>add folder</div>   </a> </li> 

i should note if type standard link in without block, runs fine:

<li><%= link_to "test", new_folder_path %></li> 

any thoughts on appreciated!

try this.

= link_to "<span class='glyphicon glyphicon-plus'></span>add folder".html_safe, new_folder_path, class: 'btn btn-default add-button add_fields' 

Comments

Popular posts from this blog

javascript - Chart.js (Radar Chart) different scaleLineColor for each scaleLine -

apache - Error with PHP mail(): Multiple or malformed newlines found in additional_header -

java - Android – MapFragment overlay button shadow, just like MyLocation button -