Connection Rails & System so that Rails can do things like updating nginx block

I am new to rails & I am trying to achieve the bellow scenario

Lets say I have a Model called Sites with Field domain name. & created an entry with domain name "example.com" & It stored to database.

So Now what I am trying to do is after save it will trigger a command to create a Nginx server block with the given Domain name "example.com" right from rails app.

I know Little bit of shell scripting but don't know how I can run the script from rails based on the data saved on rails db.

Any guideline or Code snippets would be very helpful,

Thanks



Read more here: https://stackoverflow.com/questions/64946511/connection-rails-system-so-that-rails-can-do-things-like-updating-nginx-block

Content Attribution

This content was originally published by Saleheen Khan at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: