How to do static content in Rails?

后端 未结 8 923
孤城傲影
孤城傲影 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:36

    thoughtbot has a plugin called high_voltage for displaying static content: https://github.com/thoughtbot/high_voltage

    0 讨论(0)
  • 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 %>
    
    0 讨论(0)
提交回复
热议问题