Last active
February 16, 2018 16:41
-
-
Save povodok/97842b92bde3bf90600ee972e3fef731 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
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