I'm trying to generate a variable name based on day of week. In my html.erb file, I have the following code:
<%= "@selected_venue.open_time_"+Time.now.strftime('%a').downcase %>
I'm trying to create a variable such as "@selected_venue.open_time_mon", "@selected_venue.open_time_tue", "@selected_venue.open_time_wed", etc. As you can see, I'm appending the day of week to the generic variable name "@selected_venue.open_time_" so I can get the value of the dynamically generated variable.
Instead of getting the value that the variable represents (which is a time such as 2:00PM), I keep getting the literal result: "@selected_venue.open_time_wed".
Is there a method that I can use to get the value of the dynamically generated variable?