Skip to content

rVibe/timelineJS-rails

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

timelineJS-rails

This gem packages the TimelineJS for easy use with the Rails asset pipleine.

General Installation

Add to the assets group in your Gemfile:

gem 'timelineJS-rails'

Install the gem:

bundle install

Add the Javascript to application.js:

//=require js/storyjs-embed

Example

  $(document).ready(function() {
    createStoryJS({
      type: 'timeline',
      width: '400',
      height: '500',
      lang: 'zh-ch',
      source: '/events.json',
      embed_id: 'time_line'
    });
  });

In the production environment and enable Rails asset pipleine, you need to do below:

Add the Javascript to application.js:

//=require js/timeline-min
//=require js/locale/zh-ch

Add the css to application.css:

/*
 *= require css/timeline
 */  

Init the timeline:

  $(document).ready(function() {
    createStoryJS({
      type: 'timeline',
      width: '400',
      height: '500',
      source: '/events.json',      
      embed_id: 'time_line',
      lang: '/assets/application.js',
      js: '/assets/application.js',
      css: '/assets/application.css'      
    });
  });

About

timelineJS for the Rails asset pipeline

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published