I'm wondering how to let my customer 'personalize' their view executing some of my custom functions using an mustache/handlebar format, but I'm not able to understand how to do it effectively. I have it in my mind the flow, but in code, I don't know where to start.
Example given:
I want my users to be able to invoke a function/method called read_json(url,key)
So in my mind, the flow should be to have a template like mustache or liquid and have: Today the weather is {{read_json(https://weathersystem,temperature)}} degrees
and have it rendered to: Today the weather is 56 degrees.
Or maybe having a set of functions that the user will declare as variable weather somewhere in my rails database, specific to the user like: weather=read_json("https:/weathersystem", temperature)
and then the user would be able to do something like: Today the weather is {{weather}} degrees
Since the text or function the user might want to add or {{ function }}
to be rendered every time it's invoked by the users since the text they have this could be rendered in a normal view or into an API response.
I'm kinda struggling figuring it out what or how can be done.
Cheers!