Change ReplitTag to render using ActionController (#2745) [ci skip]
This commit is contained in:
parent
68239c4cf8
commit
51837621a5
2 changed files with 10 additions and 3 deletions
|
|
@ -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
|
||||
|
|
|
|||
3
app/views/liquids/_replit.html.erb
Normal file
3
app/views/liquids/_replit.html.erb
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
<div class="ltag__replit">
|
||||
<iframe frameborder="0" height="550px" src="<%= "https://repl.it/#{id}?lite=true" %>"></iframe>
|
||||
</div>
|
||||
Loading…
Add table
Reference in a new issue