How to do static content in Rails?

后端 未结 8 957
孤城傲影
孤城傲影 2020-11-30 17:47

Looking at different options:

One is to just put the static pages in the public/ folder, but I do want the header from layout/application to be consistent.

I

8条回答
  •  北荒
    北荒 (楼主)
    2020-11-30 18:38

    Lindsaar solution is one of the best I ever seen. He build a caching static pages that expired when git revision changed.

    <%= cache "site-page-#{@page_name}-#{App.git_revision}" do %>
      <%= render :partial => @page_name %>
    <% end %>
    

提交回复
热议问题