Q: Loop through array and pass keys to function I'm trying to pass each element in events_sections array to a function, I keep getting nil, I'm not sure what I'm doing wrong here. 
event_sections = ["a_full","b_full","c_full","e_full","h_full","i_full","k_full","z_full"]
    event_sections.each do |key|
       @events[key] = Zlib.inflate(Events_Full_Sections.first."#{key}")
    end 
    render json: @events 

Your help is highly appreicated 

A: I presume you don't have @events defined earlier. So, define a empty array with that variable before the loop:
@events = []

Also, if Events_Full_Sections is a model, we don't call methods with interpolation like you tried. We use send method to call a method with str/symbol name. Like this:
event_sections = ["a_full","b_full","c_full","e_full","h_full","i_full","k_full","z_full"]
@events = []

event_sections.each do |key|
   @events[key] = Zlib.inflate(Events_Full_Sections.first.send(key))
end 
render json: @events 

I've not sure about your DB structure, so I assume it would work.
You might also save Events_Full_Sections.first in a variable outside loop, to avoid calling to db everytime.
