Module: D3C3Rails::Generators
- Includes:
- ActionView::Helpers::JavaScriptHelper, ActionView::Helpers::TagHelper, RailsJavaScriptHelpers
- Included in:
- Holder
- Defined in:
- lib/d3c3-rails/generators.rb
Overview
Generator methods for dialogs
Instance Method Summary collapse
-
#graph_generate(name, options = {}) ⇒ TrueClass
Create a new graph.
-
#graph_hide(name, column_names = []) ⇒ TrueClass
Hide columns in graph.
-
#graph_load(name, options = {}) ⇒ TrueClass
Load data into graph.
-
#graph_perform(action, name, options = {}) ⇒ TrueClass
Perform action on graph.
-
#graph_show(name, column_names = []) ⇒ TrueClass
Show columns in graph.
-
#graph_unload(name, options = {}) ⇒ TrueClass
Unload data from graph.
Instance Method Details
#graph_generate(name, options = {}) ⇒ TrueClass
Create a new graph
17 18 19 20 21 |
# File 'lib/d3c3-rails/generators.rb', line 17 def graph_generate(name, ={}) [:bindto] = "##{name}" self << "d3c3_rails.actions.generate('#{name}', #{format_type_to_js()});" true end |
#graph_hide(name, column_names = []) ⇒ TrueClass
Hide columns in graph
55 56 57 |
# File 'lib/d3c3-rails/generators.rb', line 55 def graph_hide(name, column_names=[]) graph_perform(:hide, name, column_names) end |
#graph_load(name, options = {}) ⇒ TrueClass
Load data into graph
28 29 30 |
# File 'lib/d3c3-rails/generators.rb', line 28 def graph_load(name, ={}) graph_perform(:load, name, ) end |
#graph_perform(action, name, options = {}) ⇒ TrueClass
Perform action on graph
65 66 67 68 |
# File 'lib/d3c3-rails/generators.rb', line 65 def graph_perform(action, name, ={}) self << "d3c3_rails.actions.get('#{name}').#{action}(#{format_type_to_js()});" true end |
#graph_show(name, column_names = []) ⇒ TrueClass
Show columns in graph
46 47 48 |
# File 'lib/d3c3-rails/generators.rb', line 46 def graph_show(name, column_names=[]) graph_perform(:show, name, column_names) end |
#graph_unload(name, options = {}) ⇒ TrueClass
Unload data from graph
37 38 39 |
# File 'lib/d3c3-rails/generators.rb', line 37 def graph_unload(name, ={}) graph_perform(:unload, name, ) end |