JTRailsToolbox
JTRailsToolbox contains a list of common libs used for Ruby On Rails development.
Installation
JTRailsToolbox is distributed as a gem, which is how it should be used in your app.
Include the gem in your Gemfile:
gem 'jt-rails-toolbox', '~> 1.0'
Create a jt-toolbox.yml file:
rails g jt:toolbox
What's in it?
- Exception Notification, send email notifications when errors occur
- paperclip, manage file upload
- quiet_assets, silence assets in log
- sidekiq, manage background jobs
- validates_email_format_of, who doesn't need to validate email format?
- rails-i18n Default locale data
- jt-rails-meta Manage HTML meta tags
- jt-rails-generator-user Generate a scaffold for user authentication
- jt-rails-tokenizable Generate tokens for ActiveRecord models
- simplified configuration of hostnames and
ActionMailerwith a YAML file
Exception Notification
If exception is not set in jt-toolbox.yml file, Exception Notification is disabled.
In addition to the default ignored exceptions, the following exceptions are also muted:
ActionController::InvalidCrossOriginRequestActionController::InvalidAuthenticityToken
Paperclip
convert_optionsis set to-strip, which means all metadata of images are removed, this is used for reduced the weight of images.use_timestampis et tofalse, 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.- the default fodler of images is
upload(in public folder)
Sidekiq
- configured for
ActiveJob - configured to send notification error with Exception Notification
- redis url is by default
"redis://localhost:6379/#{name of your application}"
Warning
Don't forget to install redis server and to launch sidekiq with:
bundle exec sidekiq -q default -q mailers
Hostname
hostis the hostname of your website, it's used for setting the host when you emailasset_hostis the hostname of the assets server. By default equal tohost.cdn_hostis the hostname for serving uploaded files with paperclip. By default equal toasset_host.
It'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).
ActionMailer
ActionMailer can be configured easily just with jt-toolbox.yml file.
Author
License
JTRailsToolbox is released under the MIT license. See the LICENSE file for more info.