I am trying to have a partial layout file that store all the config variables. However, I can’t access them when I use render 'layouts/config'
application.html.erb:
<!DOCTYPE html>
<html>
<head>
<title><%= full_title(yield(:name), yield(:title)) %></title>
#:name here is empty
<%= stylesheet_link_tag "application", :media => "all" %>
<%= javascript_include_tag "application" %>
<%= csrf_meta_tags %>
</head>
<body>
<%= render "layouts/config" %>
<%= yield %>
</body>
</html>
_config.html.erb:
<% provide(:name, "Grab") %>
To include a partial use <%= render :partial=>”layouts/config”%>
I would suggest if you want to have all your config variables at on place then you should create a config.yml file in the config directory and declare all the config variables there. All the config variables declared there will be available throughout the application.