I've installed Chartkick within my ROR app and I'm looking to use the timeline feature to display projects to give a simple and quick overview.
<%= @projects.each do |project|
['project.hospital', "project.construction_start", "project.construction_end"],
<% end %>
Your code is showing something you dont want, the loop instead the timeline, and it's showing , not one timeline but many of them .
Change your code to:
<% data = @projects.pluck(:hospital,:construction_start,:construction_end) %> <%= timeline data %>
This should only create one timeline with all the data about the hospitals of all projects you passed from the controller .
Note that this will only work on Rails 4+. If you have Rails 3 you will have to override the pluck method (it's not hard actually)