The issue arises from the conflict between the ERB tags <%= remote_id %> and Ruby on Rails syntax. The tag <%= remote_id %> is interpreted as a Ruby variable or method within the ERB context, causing the error "undefined local variable or method 'remote_id'.
How can i solve this
youtubereels: {
regex: /https?://www.youtube.com/shorts/([^\/\?\&]*)/,
embedUrl: 'https://www.youtube.com/embed/<%= remote_id %>',
html: "<iframe width='600' height='338' src='https://www.youtube.com/embed/<%= remote_id %>' frameborder='0' allowfullscreen></iframe>",
height: 338,
width: 600,
id: (groups) => {
const extractedId = groups[0];
const llk = groups.join('/embed/')
console.log('YouTube Reels Video ID:', groups);
return llk;
},
},