Topic: Passing external JavaScript data to a rails controller

Hello, I hope I will find some help here. I am creating a small application for error logging and reporting. Basically, I created a small javascript snippet that can be inserted in any html page and collects javascripts errors. It will collect things like error message, error type, browser name, browser version, line of occurrence in the html etc.

After collecting those parameters, I want to be able to pass them to a rails controller that will save them in the database and then display them in a dashboard table.  Can anyone help me on how to figure things out here? I'm having problems with passing data from an external javascripts to a rails controller. Also, how to design the routes.

I will appreciate any input as I am new to ruby and still learning.