开发者

How do I import refinerycms layouts into a custom controller?

开发者 https://www.devze.com 2023-03-11 15:26 出处:网络
I\'m trying to add the refinerycms application layout to a custom controller ie, layout \'application\'

I'm trying to add the refinerycms application layout to a custom controller ie,

layout 'application'

but I get the error

undefined method `browser_title' for nil:NilClass


Extracted source (around line #4):

1: <head>
2:   <meta charset='<%= ::Refinery::Application.config.encoding %>' />
3:   <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
4:   <title><%= browser_title(yield(:title)) %></title>
5:   <%= raw "<meta name=\"description\" content=\"#{@meta.meta_description}\" />" if @meta.meta_description.present? -%>
6:   <%= raw "<meta name=\"keywords\" content=\"#{@meta.meta_keywords}\">" if @meta.meta_keywords.present? -%>
7:   <%= csrf_meta_tag if RefinerySetting.find_or_s开发者_StackOverflow中文版et(:authenticity_token_on_frontend, true)-%>

How do I import the refinery layout into a custom controller?


I ended up doing things the other way around, and overriding the pages controller with my custom controller logic (from this), instead of including the refinery cms layout in my custom controller. This included the right layout, so I didn't get the error anymore.

0

精彩评论

暂无评论...
验证码 换一张
取 消