ecs
ecs

Reputation: 718

Using a timeline in Rails

I've got a rails app that I'm trying to get to use the timeline from here: http://timeline.verite.co/

When I load the page, it is creating the div 800x600, shows "loading timeline", then stops. I've had a look at the error console, and it looks like this is the problem:

[14:58:20.511] GET http://localhost:3000/assets/css/timeline.css?2.17 [HTTP/1.1 404 Not Found  807ms]
[14:58:20.523] GET http://localhost:3000/assets/js/timeline-min.js?2.17 [HTTP/1.1 404 Not Found  493ms]

It doesn't seem to be finding these files - I'm assuming it is because it is looking in the wrong place. I've had a look at the source code for the page, and these two files are loading on when I load the page, as they are in the assets folder. Why is the timeline not recognising them?

Here is what I've put in the view - I used the example JSON file from the verite website, just so I can test the timeline before I use my own data:

<div id="my-timeline"></div>
 <script>
          $(document).ready(function() {
              createStoryJS({
                  type:       'timeline',
                  width:      '800',
                  height:     '600',
                  source:     'http://timeline.verite.co/lib/timeline/data.json',
                  embed_id:   'my-timeline'
              });
          });
      </script>
<%= javascript_include_tag "storyjs-embed" %>

I can't seem to get this to work - any help would be much appreciated, thanks!

EDIT:

Ok, if I add the following two lines, I get a white background with the loading gif, but still no timeline appearing, just a permanent loading screen. What could be going wrong? I'm explicitly adding the two files in question, but it still isn't working.

<%= javascript_include_tag "timeline-min" %>
<%= stylesheet_link_tag "timeline" %>

Upvotes: 0

Views: 1283

Answers (1)

Jack
Jack

Reputation: 31

The storyjs-embed js file is looking for the timeline-min.js and timeline.css files. If you set their location in the createStoryJS function, I think it should work. However, I'm not sure how to do this. I ran into a similar problem and solved it by using the 'simple' embed technique.

Upvotes: 3

Related Questions