Skip to content

Instantly share code, notes, and snippets.

@onefriendaday
Last active August 20, 2019 22:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save onefriendaday/b4782a1dae242a5811788069514dd2dd to your computer and use it in GitHub Desktop.
Save onefriendaday/b4782a1dae242a5811788069514dd2dd to your computer and use it in GitHub Desktop.
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