how can i call the method get_data from my view index.html.erb?
class CalculationController < ApplicationController def index #------------------Module1-----------------------------------------
#From json to hash - consumption_profile_generic file_gen = File.read("consumption_profile_generic_some_columns.js") @data_hash_gen = JSON.parse(file_gen) #Passing variable introduced by the user in mod1 @user_entry_module1 = params[:user_entry_module1] # Filtering date and consumption_% ind 2 vectors and then merging them num = @data_hash_gen.count @vectorA = Array.new @vectorB = Array.new i = 0 while num > i @vectorA[i] = @data_hash_gen[i]["consumption_%"].to_f * @user_entry_module1.to_i @vectorB[i] = @data_hash_gen[i]["date"] i += 1 end @vectorC = @vectorB.zip(@vectorA) end def get_data @cuca = 2 end end
I want that the variable @cuca will be printed on the screen.