Is it possible to do partial in index.html in a shared folder?

Is it possible to do partial in index.html in a shared folder?

I need to display the partial application / view / showcase / _last_five in '/public/index.html'.

I tested with:

    <%= render(:partial => "showcase/last_five" )%>

but do not process the code.

Do I need to move the index to the controller? What can I download using javascript?

+3
source share
2 answers

Yes, you will need to move the contents of index.html to the controller (e.g. the PagesController # index). Files located in a public folder are usually served directly by the web server.

+3
source

URL- public/index.html, . , .

yourAppName/config/routes.rb URL "/", . "showcase # index", :

YourAppName::Application.routes.draw do
    match "/", :to => "showcase#index"

    root :to => "showcase#index"

, URL- , "http://yourappname.com/", , .

, , , .html.erb. .html Ruby.

0

Source: https://habr.com/ru/post/1785168/


All Articles