- You MUST NOT try and generate a Rails app from scratch on your own by generating each file. For a NEW app you MUST use
rails newfirst to generate all of the boilerplate files necessary. - Create an app in the current directory with
rails new . - Use Tailwind CSS for styling. Use
--css tailwindas an option on therails newcall to do this automatically. - Use Ruby 3.2+ and Rails 8.0+ practices.
- Use the default Minitest approach for testing, do not use RSpec.
- Default to using SQLite in development.
rails newwill do this automatically but take care if you write any custom SQL that it is SQLite compatible. - An app can be built with a devcontainer such as
rails new myapp --devcontainerbut only do this if requested directly. - Rails apps have a lot of directories to consider, such as app, config, db, etc.
- Adhere to MVC conventions: singular model names (e.g., Product) map to plural tables (products); controllers are plural.
- Guard against incapable browsers accessing controllers with `allo
| ruby '2.7.1' | |
| gem 'rails', github: 'rails/rails' | |
| gem 'tzinfo-data', '>= 1.2016.7' # Don't rely on OSX/Linux timezone data | |
| # Action Text | |
| gem 'actiontext', github: 'basecamp/actiontext', ref: 'okra' | |
| gem 'okra', github: 'basecamp/okra' | |
| # Drivers |
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 expose-loader
How does Braintree work?
-> Your project backend generates a client token using the Ruby SDK for the frontend that initializes the JavaScript SDK using the client token.
--> The Braintree-provided JavaScript library encrypts sensitive data using the public key and communicates with Braintree before the form is ever posted to your server.
---> Once the data reaches Braintree’s servers, it is decrypted using the keypair’s private key, then returns a payment method nonce to your client code. Your code relays this nonce to your server.
----> Your server-side code provides the payment method nonce to the Ruby SDK to perform Braintree operations.
rails g model order item_id:integer donor_id:integer
| ffmpeg -i input.mp3 -acodec pcm_s16le -ac 1 -ar 16000 output.wav | |
| # To convert all mp3 files in a directory in Linux: | |
| for f in *.mp3; do ffmpeg -i "$f" -acodec pcm_s16le -ac 1 -ar 16000 "${f%.mp3}.wav"; done | |
| # Or Windows: | |
| for /r %i in (*) do ffmpeg -i %i -acodec pcm_s16le -ac 1 -ar 16000 %i.wav |
Hey there, apparently people are still using this Gist from 2013! It's out of date! Consult the Github docs.
- Create a GitHub account on github.com.
- Download either [GitHub for Mac][1] or [GitHub for Windows][2], depending on your operating system. Open the app and log in using the account you just created.
- (On Mac): After you login, click advanced and make sure that your name and email are correct. Then, click "Install Command Line Tools", just in case you want to start using the command line later in life.
- Create a new repository in your GitHub application. Name it your-username.github.io. The name is very important. Note the folder that GitHub is saving the repository to. Make sure the "Push to GitHub?" box is checked.
- Move your website's files into the folder that GitHub just created when you made the repository. IMPORTANT: Your homepage HTML file must be called "index.html", and it must exist in the top-level
| $ brew install openvpn | |
| ==> Installing openvpn dependency: lzo | |
| ==> Downloading http://www.oberhumer.com/opensource/lzo/download/lzo-2.06.tar.gz | |
| ######################################################################## 100.0% | |
| ==> ./configure --prefix=/usr/local/Cellar/lzo/2.06 --enable-shared | |
| ==> make | |
| ==> make check | |
| ==> make install | |
| /usr/local/Cellar/lzo/2.06: 27 files, 552K, built in 27 seconds | |
| ==> Installing openvpn |

