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

OpenCV OpenCL: Convert Mat to Bitmap in JNI Layer for Android -

android - org.xmlpull.v1.XmlPullParserException: expected: START_TAG {http://schemas.xmlsoap.org/soap/envelope/}Envelope -

python - How to remove the Xframe Options header in django? -