From this tutorial.
Gemfile.rb:
- Rspec-rails to development and test groups
group :development, :test do
gem 'rspec-rails', '~> 3.5'
From this tutorial.
Gemfile.rb:
group :development, :test do
gem 'rspec-rails', '~> 3.5'
RUN apt update
RUN apt upgrade -y
RUN apt install -y apt-utils
RUN a2enmod rewrite
RUN apt install -y libmcrypt-dev
RUN apt install -y libicu-dev
RUN docker-php-ext-install -j$(nproc) intl
RUN apt-get install -y libfreetype6-dev libjpeg62-turbo-dev libpng12-dev
RUN docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/
# app/workers/active_admin_export_worker.rb | |
class ActiveAdminExportWorker | |
include Sidekiq::Worker | |
sidekiq_options queue: 'high' | |
def perform(options = {}) | |
model = options[:model_name].classify.constantize | |
path = "#{Rails.root.to_s}/tmp/#{filename(options[:name])}" | |
columns = model.send(:column_names) |
Cheat Sheets are greate but they are not a substitute for learning the framework and reading the documentation as we most certainly have not covered every potential example here. Please refer to the Rails Command Line Docs for more information.
You can get all of this information on the command line.
rails generate
with no generator name will output a list of all available generators and some information about global options.
rails generate GENERATOR --help
will list the options that can be passed to the specified generator.
dbms.mode=CORE | |
dbms.connector.bolt.listen_address=:7691 | |
dbms.connector.http.listen_address=:7481 | |
dbms.connector.https.listen_address=:7371 | |
causal_clustering.initial_discovery_members=localhost:5001,localhost:5002,localhost:5003 | |
causal_clustering.discovery_listen_address=127.0.0.1:5001 | |
causal_clustering.transaction_listen_address=:6001 | |
causal_clustering.raft_listen_address=:7001 |
$ sudo apt-get install wget | |
$ sudo apt-get install build-essential | |
$ sudo apt-get install libc6-dev | |
$ wget ftp://ftp.freetds.org/pub/freetds/stable/freetds-1.00.27.tar.gz | |
$ tar -xzf freetds-1.00.27.tar.gz | |
$ cd freetds-1.00.27 | |
$ ./configure --prefix=/usr/local --with-tdsver=7.3 | |
$ make | |
$ make install |
URL | HTTP Verb | Action |
---|---|---|
/photos/ | GET | index |
/photos/new | GET | new |
/photos | POST | create |
/photos/:id | GET | show |
/photos/:id/edit | GET | edit |
/photos/:id | PATCH/PUT | update |
/photos/:id | DELETE | destroy |
So i was using Rails 4.1 with Unicorn v4.8.2 and when i tried to deploy my app it doesn't start properly and into the unicorn.log file i found this error message: | |
"app error: Missing `secret_key_base` for 'production' environment, set this value in `config/secrets.yml` (RuntimeError)" | |
After a little research i found that Rails 4.1 change the way to manage the secret_key, so if we read the secrets.yml file located at exampleRailsProject/config/secrets.yml (you need to replace "exampleRailsProject" for your project name) you will find something like this: | |
# Do not keep production secrets in the repository, | |
# instead read values from the environment. | |
production: | |
secret_key_base: <%= ENV["SECRET_KEY_BASE"] %> |