Hello I have following problem.
I have a hash filled with the html parameters (params):
Parameters: "info"=>{"parameter2"=>{"r1"=>"aa", "r2"=>"bb", "r3"=>"cc", "r4"=>"dd", "r5"=>"ee"}
You can access this values like this:
<%= params[:info][:parameter2][:r1] %>
--> it works fine
But I have a loop, and want to access these values through a variable like that:
<% for number_row in (1..@numb_rows) %>
<%= params[:info][:parameter2]["r" + number_row.to_s] %>
<% end %>
--> it doesn´t work . I always get this error :
can't convert nil into String
But the "r1" does exist. Why it always says, that it can not convert nil into String.
How I can access these params with an changing variable ??
I need something like this : params[:info][:parameter2][@var]