如何自定义Comfy CMS页面生成的视图?

时间:2019-07-01 08:05:39

标签: ruby-on-rails-3 comfortable-mexican-sofa

在我的Rails 3.2应用中,我正在使用comfortable_mexican_sofa 1.8

我已经在CMS管理员中创建了一些“ CMS页面”(一些静态页面,例如“关于我们”,“联系我们”等)。所有这些页面均由“ CMS管理”部分中的字段填充。

但是我不知道如何自定义模板,以使其正确呈现关于我们的信息。

这是日志:

Started GET "/about" for 127.0.0.1 at 2019-07-01 01:42:05 -0500
Processing by CmsContentController#render_html as HTML
  Parameters: {"cms_path"=>"about"}
   (1.3ms)  SELECT COUNT(*) FROM "admins" WHERE (admins.superadmin = 't')
   (0.7ms)  SELECT COUNT(*) FROM "cms_sites" 
  Cms::Site Load (0.4ms)  SELECT "cms_sites".* FROM "cms_sites" LIMIT 1
  Cms::Page Load (1.5ms)  SELECT "cms_pages".* FROM "cms_pages" WHERE "cms_pages"."site_id" = 1 AND "cms_pages"."is_published" = 't' AND "cms_pages"."full_path" = '/about' ORDER BY cms_pages.position LIMIT 1
  Cms::Layout Load (0.8ms)  SELECT "cms_layouts".* FROM "cms_layouts" WHERE "cms_layouts"."id" = 5 ORDER BY cms_layouts.position LIMIT 1
  Cms::Block Load (1.0ms)  SELECT "cms_blocks".* FROM "cms_blocks" WHERE "cms_blocks"."page_id" = 9 AND "cms_blocks"."identifier" = 'blurb' LIMIT 1
  Cms::Page Load (0.8ms)  SELECT "cms_pages".* FROM "cms_pages" WHERE "cms_pages"."id" = 9 ORDER BY cms_pages.position LIMIT 1
  CACHE (0.0ms)  SELECT "cms_layouts".* FROM "cms_layouts" WHERE "cms_layouts"."id" = 5 ORDER BY cms_layouts.position LIMIT 1
  Cms::Layout Load (0.8ms)  SELECT "cms_layouts".* FROM "cms_layouts" WHERE "cms_layouts"."id" = 2 ORDER BY cms_layouts.position LIMIT 1
  Cms::Block Load (1.3ms)  SELECT "cms_blocks".* FROM "cms_blocks" WHERE "cms_blocks"."page_id" = 9
  Rendered inline template (1.5ms)
  Rendered partials/cms/pages/_header.html.haml (78.3ms)
  Cms::Page Load (0.7ms)  SELECT "cms_pages".* FROM "cms_pages" WHERE "cms_pages"."id" = 1 ORDER BY cms_pages.position LIMIT 1
  Rendered inline template within layouts/cms_inside (108.3ms)
  Cms::Page Load (1.3ms)  SELECT "cms_pages".* FROM "cms_pages" WHERE "cms_pages"."site_id" = 1 AND (parent_id IS NULL) ORDER BY cms_pages.position LIMIT 1
  Cms::Page Load (0.7ms)  SELECT "cms_pages".* FROM "cms_pages" WHERE "cms_pages"."parent_id" = 1 AND "cms_pages"."is_published" = 't' ORDER BY cms_pages.position OFFSET 1
  Rendered shared/_navbar.html.erb (13.5ms)
  Cms::Snippet Load (1.2ms)  SELECT "cms_snippets".* FROM "cms_snippets" WHERE "cms_snippets"."site_id" = 1 AND "cms_snippets"."identifier" = 'footer_contact' ORDER BY cms_snippets.position LIMIT 1
  Rendered inline template (1.5ms)
  Rendered shared/_footer.html.erb (13.6ms)
Completed 200 OK in 386.2ms (Views: 324.8ms | ActiveRecord: 12.5ms)

我的routes.rb中没有声明“关于”路径,也没有about_controller,因此我没有app/views/cms/pages/about.html.erb或类似的东西。

我确实有layouts/cms_inside之类的东西可以正确显示,但是它有一个yield块,仅显示从CMS Admin中的文本字段收集的数据。

我已经在GH存储库中检查了文档,但是不清楚如何自定义这些生成的页面。

有想法吗?

0 个答案:

没有答案