This blogpost shows how to setup Rails 6 with Bootstrap 4.
This snippet shows a somehow different and less customized approach.
$ rails new rails6-bootstrap4
$ bundle --binstubs
$ yarn add bootstrap jquery popper.js
This blogpost shows how to setup Rails 6 with Bootstrap 4.
This snippet shows a somehow different and less customized approach.
$ rails new rails6-bootstrap4
$ bundle --binstubs
$ yarn add bootstrap jquery popper.js
root = true | |
[*] | |
indent_style = space | |
indent_size = 2 | |
end_of_line = lf | |
charset = utf-8 | |
trim_trailing_whitespace = true | |
insert_final_newline = true |
Optimistic Locking assumes that a database transaction conflict is very rare to happen. It uses a version number of the record to track the changes. It raise an error when other user tries to update the record while it is lock.
usage
Just add a lock_version column to the table you want to place the lock and Rails will automatically check this column before updating the record.
Pessimistic locking assumes that database transaction conflict is very likely to happen. It locks the record until the transaction is done. If the record is currently lock and the other user make a transaction, that second transaction will wait until the lock in first transaction is release.
usage
require 'sidekiq/api' | |
Sidekiq::ScheduledSet.new.find_job("61374d5d51db323507376158") |
HTTP status code symbols for Rails | |
Thanks to Cody Fauser for this list of HTTP responce codes and their Ruby on Rails symbol mappings. | |
Status Code Symbol | |
1xx Informational | |
100 :continue | |
101 :switching_protocols | |
102 :processing |
For this blog post we will be using ruby version 2.4.0 and rails version 5.1.4 as backend and React/Redux as frontend. Adding Google Sign in functionality in your application can be done in two popular ways.
Adding google sign in functionality in the frontend with google api client gapi
.
Adding google sign in functionality logic in the backend server.
If your application has separate backendend with APIs feeding data to the frontend React application, I suggest you to follow the step 2. If you want yo enhance your application security, then you implement both.
It's important to note that running this reset will drop any existing data you have in the application
heroku restart
heroku pg:reset DATABASE
(no need to change the DATABASE
)heroku run rake db:migrate
heroku run rake db:seed
(if you have seed)One liner
Generally, you will add a git remote for your Heroku app during the Heroku app creation process, i.e. heroku create
. However, if you are working on an existing app and want to add git remotes to enable manual deploys, the following commands may be useful.
Note that on Heroku, you must always use master
as the destination branch on the remote. If you want to deploy a different branch, you can use the syntax local_branch:destination_branch
seen below (in this example, we push the local staging
branch to the master
branch on heroku.
$ git remote add staging https://git.heroku.com/staging-app.git