{"id":19856943,"url":"https://github.com/johnvuko/jt-rails-toolbox","last_synced_at":"2026-05-10T12:02:29.253Z","repository":{"id":32936918,"uuid":"36532907","full_name":"johnvuko/jt-rails-toolbox","owner":"johnvuko","description":"Common libs used for Ruby On Rails development.","archived":false,"fork":false,"pushed_at":"2018-05-25T10:19:07.000Z","size":41,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-15T03:02:56.038Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/johnvuko.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-05-29T22:44:01.000Z","updated_at":"2018-05-25T10:19:01.000Z","dependencies_parsed_at":"2022-08-07T18:30:13.213Z","dependency_job_id":null,"html_url":"https://github.com/johnvuko/jt-rails-toolbox","commit_stats":null,"previous_names":["johnvuko/jt-rails-toolbox"],"tags_count":39,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johnvuko%2Fjt-rails-toolbox","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johnvuko%2Fjt-rails-toolbox/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johnvuko%2Fjt-rails-toolbox/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johnvuko%2Fjt-rails-toolbox/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/johnvuko","download_url":"https://codeload.github.com/johnvuko/jt-rails-toolbox/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241246110,"owners_count":19933299,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-12T14:17:02.601Z","updated_at":"2026-05-10T12:02:29.159Z","avatar_url":"https://github.com/johnvuko.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# JTRailsToolbox\n\n[![Gem Version](https://badge.fury.io/rb/jt-rails-toolbox.svg)](http://badge.fury.io/rb/jt-rails-toolbox)\n\nJTRailsToolbox contains a list of common libs used for Ruby On Rails development.\n\n## Installation\n\nJTRailsToolbox is distributed as a gem, which is how it should be used in your app.\n\nInclude the gem in your Gemfile:\n\n\tgem 'jt-rails-toolbox', '~\u003e 2.0'\n\nCreate a `jt-toolbox.yml` file:\n\n\trails g jt:toolbox\n\nA simple configuration of `jt-toolbox.yml` file:\n\n```yml\nproduction:\n  exception:\n    slack:\n      webhook_url: https://hooks.slack.com/services/XXXXXXXX\n    email_prefix: '[ERROR]'\n    sender_address: \"Your website \u003cerror@example.com\u003e\"\n    exception_recipients:\n      - my_email_for_errors@example.com\n  files:\n    folder: upload\n  mail:\n    from: \"Your website \u003ccontact@example.com\u003e\"\n    delivery_method: smtp\n    smtp_settings:\n      address: smtp.gmail.com\n      port: 587\n      domain: example.com\n      user_name: username\n      password: password\n      authentication: plain\n      enable_starttls_auto: true\n  hosts:\n    host: https://www.example.com\n    asset_host: https://asset.example.com\n    cdn_host: https://cdn.example.com\n  sidekiq:\n    redis_url: redis://localhost:6379/my_app\n    network_timeout: 5\n```\n\n## What's in it?\n\n- [http_accept_language](https://github.com/iain/http_accept_language), helps you detect the users preferred language, as sent by the \"Accept-Language\" HTTP header\n- [dotenv](https://github.com/bkeepers/dotenv), load environment variables from .env file\n- [Exception Notification](https://github.com/smartinez87/exception_notification), \nsend notifications when errors occur (email, slack)\n- [paperclip](https://github.com/thoughtbot/paperclip), manage file upload\n- [sidekiq](https://github.com/mperham/sidekiq), manage background jobs\n- [validates_email_format_of](https://github.com/validates-email-format-of/validates_email_format_of), who doesn't need to validate email format?\n- [validates_phone_format_of](https://github.com/jonathantribouharet/validates_phone_format_of), validate phone against E.164 format\n- [rails-i18n](https://github.com/svenfuchs/rails-i18n) Default locale data\n- [jt-rails-meta](https://github.com/jonathantribouharet/jt-rails-meta) Manage HTML meta tags\n- [jt-rails-generator-user](https://github.com/jonathantribouharet/jt-rails-generator-user) Generate a scaffold for user authentication\n- [jt-rails-tokenizable](https://github.com/jonathantribouharet/jt-rails-tokenizable) Generate tokens for ActiveRecord models\n- [jt-rails-address](https://github.com/jonathantribouharet/jt-rails-address) Helpers for addresses / geolocation management\n- [jt-rails-enum](https://github.com/jonathantribouharet/jt-rails-enum) Enum in models\n- [validates_timeliness](https://github.com/adzap/validates_timeliness) Date and time validation plugin for ActiveModel\n- simplified configuration of hostnames and `ActionMailer` with a YAML file\n- some helper methods\n\n### http_accept_language\n\nTo install `http_accept_language` you just have to add a line in your `ApplicationController`\n\n```ruby\nclass ApplicationController \u003c ActionController::Base\n  include HttpAcceptLanguage::AutoLocale\n\nend\n```\n\n### Dotenv\n\nIt's a good practice to not include credentials for third party services in your code. You can defined it in a `.env` file which I recommend to not include in your git repository.\n\n### Exception Notification\n\nIf `exception` is not set in `jt-toolbox.yml` file, Exception Notification is disabled.\nIn addition to the default ignored exceptions, the following exceptions are also muted:\n\n- `ActionController::InvalidCrossOriginRequest`\n- `ActionController::InvalidAuthenticityToken`\n\n### Paperclip\n\n- `convert_options` is set to `-strip`, which means all metadata of images are removed, this is used for reduced the weight of images.\n- `use_timestamp` is et to `false`, it's a good practice to have unique url for image and url without parameters, instead of using the timestamp we use the fingerprint of the image. [More informations here.](https://github.com/thoughtbot/paperclip#md5-checksum--fingerprint)\n- the default fodler of images is `upload` (in public folder)\n\n### Sidekiq\n\n- configured for `ActiveJob`\n- configured to send notification error with Exception Notification\n- redis url is by default `redis://localhost:6379/0` and the namespace is `#{name of your application}` for production and `#{name of your application}-{environment}` for others.\n\n#### Warning\n\nDon't forget to install redis server and to launch sidekiq with:\n\n```\nbundle exec sidekiq -e $RAILS_ENV -q default -q mailers -d -L log/sidekiq.log -P tmp/pids/sidekiq.pid\n```\n\n### Hostname\n\n- `host` is the hostname of your website, it's used for setting the host when you email\n- `asset_host` is the hostname of the assets server. By default equal to `host`.\n- `cdn_host` is the hostname for serving uploaded files with paperclip. By default equal to `asset_host`.\n\nIt's a good practice to have a different domains for your web server and your file server (search \"Cookieless Domain\" on google for more informations).\n\n### ActionMailer\n\nActionMailer can be configured easily just with `jt-toolbox.yml` file.\n\n### Helper methods\n\n### google_anaytics_tag\n\nIt will add automatically in production environment the javascript code for Google Analytics.\nYou just have add at the end of your `app/views/layouts/application.html.erb` file:\n\n```\n\u003c%= google_anaytics_tag 'UA-XXXXXXX-X' %\u003e\n```\n\n## Author\n\n- [Jonathan VUKOVICH TRIBOUHARET](https://github.com/jonathantribouharet) ([@johntribouharet](https://twitter.com/johntribouharet))\n\n## License\n\nJTRailsToolbox is released under the MIT license. See the LICENSE file for more info.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjohnvuko%2Fjt-rails-toolbox","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjohnvuko%2Fjt-rails-toolbox","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjohnvuko%2Fjt-rails-toolbox/lists"}