Last active
August 20, 2019 22:15
-
-
Save onefriendaday/b4782a1dae242a5811788069514dd2dd to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class PagesController < ApplicationController | |
def index | |
response.headers['X-FRAME-OPTIONS'] = 'ALLOWALL' | |
client = Storyblok::Client.new( | |
logger: logger, | |
cache_version: Time.now.to_i, | |
token: 'Dv2ok3DqODzzb8QUuN2XCgtt', | |
version: 'draft' | |
) | |
@story = client.story(params[:path])['data']['story'] | |
end | |
end | |
# Add a helper to render dynamic partials | |
# module Helpers | |
# def include_slim(name, options = {}, &block) | |
# Slim::Template.new("#{name}.slim", options).render(self, &block) | |
# end | |
# end | |
# Your page template pages/index.slim.html: | |
# - page['content']['body'].each do |block| | |
# = include_slim block['component'], block |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment