Skip to content

conflict tag <%= remote_id %> with ruby on rails while using in erb.html file #116

@devstracks

Description

@devstracks

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;
},
},

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions