Change ReplitTag to render using ActionController (#2745) [ci skip]

This commit is contained in:
Mario See 2019-05-07 16:50:50 -04:00 committed by Mac Siri
parent 68239c4cf8
commit 51837621a5
2 changed files with 10 additions and 3 deletions

View file

@ -1,13 +1,17 @@
class ReplitTag < LiquidTagBase
PARTIAL = "liquids/replit".freeze
def initialize(tag_name, id, tokens)
super
@id = parse_id(id)
end
def render(_context)
'<div class="ltag__replit">
<iframe frameborder="0" height="550px" src="https://repl.it/' + @id + '?lite=true"></iframe>
</div>'
ActionController::Base.new.render_to_string(
partial: PARTIAL,
locals: {
id: @id
},
)
end
private

View file

@ -0,0 +1,3 @@
<div class="ltag__replit">
<iframe frameborder="0" height="550px" src="<%= "https://repl.it/#{id}?lite=true" %>"></iframe>
</div>