DEV Community

Discussion on: Live previews with Rails and StimulusReflex

Collapse
 
strzibny profile image
Josef Strzibny

Interesting!

Am I right in assuming that in the following snipped:

class ComposerReflex < ApplicationReflex
  def preview
    morph "#preview", element.value
  end
end
Enter fullscreen mode Exit fullscreen mode

We can now wrap "element.value" with any kind of Ruby method like a call to process Markdown?

Collapse
 
leastbad profile image
leastbad

Anything that ultimately ends up emitting a String, sir!