Not knowing your entire goal but what you could use is the mcollective-client gem in your rails application and have the puppet mcollective agent, which PuppetLabs made, and you can run puppet related commands like you would with "puppet resource".
So right now you can do something like "puppet resource user root" and it will return back the definition how it would look in puppet. You can also make changes, using the previous example, by adding on in the command the property fields in key=value format (e.g. puppet resource user root password='<password>')