Skip to content

Instantly share code, notes, and snippets.

@povodok
Last active February 16, 2018 16:41
Show Gist options
  • Save povodok/97842b92bde3bf90600ee972e3fef731 to your computer and use it in GitHub Desktop.
Save povodok/97842b92bde3bf90600ee972e3fef731 to your computer and use it in GitHub Desktop.
def self.render_block(path)
url = path.gsub('http://localhost:3000/', '/')
mask = '*'
blocks = []
Block.where('address Like ?', "%#{mask}").each do |block|
blocks << block.html_block if url.match(block.address)
end
Block.where('address Like ?', url).each do |block|
blocks << block.html_block
end
blocks
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment