How to get root path of rails app -


i novice rails. have been using lamp long time. looking {{url::to('/')}} laravel.

i not want use link_to creates entire anchor tag defeats purpose of isolating views. want value put in href tag.

<a href="<%= write here??? %>" class="btn btn-success">this link</a> 

rails has has root_path , root_url helpers

you seem quite confused link_to not compromise "isolation" of views. helper method makes possible create dynamic html without doing lot of interpolation.

<%= link_to t('home'), root_path, class: 'btn btn-success' %> 

Comments

Popular posts from this blog

java - Solr query version issue: Invalid version or the data in not in 'javabin' format -

Hard vs. Soft Water: What's The Difference?

Why People Get Naked Before Freezing To Death