how to use ajax with json in ruby on rails?

Where do I start in creating a Ruby on Rails app that involves videos and thumbnails?

  • I want to create an app in Ruby on Rails that when a user pastes the url of a video, the thumbnail is embedded, and when the user clicks the thumbnail, the video is embedded with ajax. Should I have a separate model for both the thumbnail and the video? Or should the thumbnail be a field in the video table? What should I be storing in my database? I plan on using http://Embedly.com. I've read the documentation, but there are a bunch of different tutorials and I'm not sure which one to use. Specifically how do I get the thumbnail and the video with Embedly? I would really, really appreciate any help.

  • Answer:

    There won't be a need to create two separate models. Only one model is enough, you can store both thumbnail link and video link in your database. Whenever a thumb is required you can hit the url and display the thumbnail image, this will save a lot of space.

Avinash Bangar at Quora Visit the source

Was this solution helpful to you?

Other answers

You should check out the example web app developed here.  http://rails-nutshell.labs.oreilly.com/ch01.html

Abhinav Sarangi

Related Q & A:

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.