Railsochrome
Project created just for fun and because of curiosity.
The idea of this project is to print log messages from Rails app in Chrome console. It will work even if you have a simple JSON API call.
What is funny it can print log messages from the models. Just call a class method Railsochrome.log
.
How it works see on the diagram below:
Usage
Close the repo
Install chrome extension from the source code.
Add gem and use in your code:
# controller
def index
Railsochrome.log("Opening index action")
Railsochrome.log("user_id = #{rand(111)}")
Railsochrome.log("account_id = #{rand(111)}")
@projects = Project.all
end
# model
class Project < ApplicationRecord
after_initialize do
Railsochrome.log("after_initialize project id=#{self.id}")
end
end
Installation
gem "railsochrome"
And then execute:
$ bundle
Or install it yourself as:
$ gem install railsochrome
Contributing
Contribution directions go here.
License
The gem is available as open source under the terms of the MIT License.