Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4058122
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T15:02:23+00:00 2026-05-20T15:02:23+00:00

I dynamically generate the title of a video from the embedly API in my

  • 0

I dynamically generate the title of a video from the embedly API in my application.js file with:

$(this).parent().prepend('<p>'+ oembed.title + '<p>');

Bear in mind that code is taken out of context.

Now I want to make the title a link to that video’s show view. However, I don’t believe I have access to named routes in my application.js file. What should I do?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T15:02:24+00:00Added an answer on May 20, 2026 at 3:02 pm

    This is a long way of going about it (hopefully someone else comes up with a better solution), but perhaps in the view where the title is being generated, you can include the URL to the show view in a data- attribute, generated by ERB (Or Haml or whatever). For example:

    <div class="video">
      <whatever class="my_embedly_object" data-show-url="<%= video_path(@video) %>" />
    </div>
    

    Then you can access the data-show-url via Javascript in your application.js code and use it to generate the link.

    url = $(this).attr('data-show-url');
    $(this).parent().prepend('<p><a href="' + url + '">' + oembed.title + '</a></p>');
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'd like to dynamically generate content and then render to a PDF file. This
i'm using this to generate a textbox dynamically:` <html> <head> <title>Dynamic Form</title> <script type=text/javascript
This code should not generate any HTML button dynamically. Coz there is no div
How might one dynamically generate a temporary RSS feed, on the fly, from a
I'm building a quiz web application that is dynamically generated from a database on
I'm trying to dynamically generate a gif image of a specified size and color
The eval function is a powerful and easy way to dynamically generate code, so
With ASP.NET MVC (or using HttpHandlers) you can dynamically generate URLs, like the one
Given a regular expression, I'm looking for a package which will dynamically generate the
i've got a ComboBox that i generate dynamically and fill with some items. i

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.