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 "" & 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 "" 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,


Read more here:

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: