Module: RailsDataExplorer::ActionViewExtension

Defined in:
lib/rails_data_explorer/action_view_extension.rb

Overview

Responsibilities:

* Add rails-data-explorer view helpers to ActionView
* Render rails-data-explorer generated content

Collaborators:

* RailsDataExplorer
* Exploration

Instance Method Summary collapse

Instance Method Details

#rails_data_explorer(rde) ⇒ Object

Renders the entire RailsDataExplorer view

Parameters:



17
18
19
20
21
22
23
24
# File 'lib/rails_data_explorer/action_view_extension.rb', line 17

def rails_data_explorer(rde)
  (:div, class: 'rails-data-explorer') do
    [
      rde_toc(rde.data_series_names, rde.explorations_with_charts_available),
      rde_explorations_with_charts(rde.explorations_with_charts_to_render),
    ].join.html_safe
  end
end

#reset_filterrific_url(opts = {}) ⇒ Object

Returns a url that can be used to reset the Filterrific params when rails-data-explorer is used in combination with Filterrific.



28
29
30
31
32
# File 'lib/rails_data_explorer/action_view_extension.rb', line 28

def reset_filterrific_url(opts = {})
  url_for(
    { filterrific: { reset_filterrific: true } }.merge(opts)
  )
end