I have a helper method that returns around 10 values/variables to a view. Calling this method in the view is a mess if i need to make use of local variables and not the instance variables returned by the helper.
I also don't want to make use of multiple helper methods for all these different values as it will duplicate my code.
For eg: example_helper.rb
def multiple_return_values
return a,b,c,d,e,f,g,h,i,j
end
example_view.html.erb
<% a,b,c,d,e,f,g,h,i,j = multiple_return_values %>
OR
<% values = multiple_return_values %>
<% values[0] %>
<% values[1] %>
.
.
.
<% values[9] %>
I don't want to use these above blocks of code(for example_view.html.erb). Neither i want to use instance variables coming from the helper. I want to use only local variables in views.
What is the best way to use these multiple values returned from the helper in the view using only local variables?
my_struct = multiple_return_valuesthenmy_struct.xmy_struct.ymy_struct.z...