I have a report object that get's data from other APIs when the user presses the "Get Report" Button.
How do I design new
and create
to get parameters from another function? This is what my controller looks like:
def new
@run = Run.new
end
def create
param_holder = get_payload
@run = Run.new(param_holder)
end
def get_payload
statushash = Hash.new
# placeholder data for testing below
statushash[:daterun] = Time.now.strftime("%m/%d/%Y")
statushash[:status] = "OK"
statushash[:count] = 13
return statushash
end
Does anyone have suggestions for learning resources and to ask basic questions like this?