私の使うGem
```ruby:Gemfile
#! vim: ruby
Yuto's Gemfile
source 'https://rubygems.org'
gem 'rails'
Authentication
gem 'devise' # Flexible authentication solution for Rails with Warden
gem 'devise-i18n' # Translations for the devise gem
gem 'omniauth-facebook' # OmniAuth strategy for Facebook
gem 'omniauth-twitter' # OmniAuth strategy for Twitter
gem 'omniauth-google-oauth2' # OmniAuth strategy for Google
gem 'omniauth-tumblr' # OmniAuth strategy for Tumblr
gem 'omniauth-amazon' # OmniAuth strategy for...
Created by Yuto at 2022-01-21 17:42
Dùng foreman để khởi động Ruby on Rails application với nhiều process
Foreman là gì
Foreman là một tool dùng để quản lý nhiều process cùng chạy của một Rails application, các process đọc từ file có tên là Procfile, mình nghĩ Proc ở đây là viết tắt của process 😆
Cài đặt
Cài đặt gem foreman
gem install foreman
Hoặc bỏ vào Gemfile của Rails application
ruby:Gemfile
group :development do
gem 'foreman'
...
end
Cách sử dụng
Trong terminal gõ foreman -h sẽ hiển thị ra danh sách các lệnh, options
```
Commands:
foreman check # Validate your...
Updated by Yuto at 2021-01-16 17:55
Dùng slim làm template engine cho trang web Ruby on Rails
Thông thường khi mới làm quen với Rails thì chúng ta vẫn dùng template engine mặc định là *.html.erb để viết. Hôm nay mình giới thiệu cho những bạn nào chưa biết về slim template engine, dùng slim để viết trang web sẽ tiết kiệm thời gian, và việc viết code cũng trở nên thoải mái hơn phần nào.
Đây là trang web để các bạn tìm hiểu về SLIM: http://slim-lang.com (http://slim-lang.com)
Mình sẽ so sánh hai đoạn code, được viết bằng ERB thông thường và SLIM như sau:
:*.html.erb
<table>
<%...
Created by Yuto at 2021-01-12 19:16