Skip to content

Instantly share code, notes, and snippets.

# rails (4.2.0), devise (3.5.1)
# in config/environments/staging.rb
config.action_mailer.default_url_options = { host: ENV['HOSTNAME'] }
Rails.application.routes.default_url_options[:host] = ENV['HOSTNAME']
config.action_mailer.delivery_method = :smtp
config.action_mailer.smtp_settings = {
address: ENV['SMTP_SERVER'],
port: ENV['SMTP_PORT'],
user_name: ENV['SMTP_USER'],
@nhattan
nhattan / gist:0c208c23674a8dea883c
Last active August 29, 2015 14:20
Solve conflict

Solve Conflicts

Get newest code from upstream/master to your master branch

git checkout master
git pull upstream master

Checkout to current task and rebase with master branch

How to install PhantomJS on Ubuntu

Version: 1.9.8

Platform: x86_64

First, install or update to the latest system software.

sudo apt-get update
sudo apt-get install build-essential chrpath libssl-dev libxft-dev
@nhattan
nhattan / gist:448e346d2e6b435d16d9
Last active August 29, 2015 14:17
Response standard

Current

{
  "errors": {
    "user": {
      "starting_stage_id": [
        "Invalid"
      ],
      "checklist_id": [
 "can't be blank"
@nhattan
nhattan / gist:88b8468a18b10947ac06
Last active August 29, 2015 14:16
Cache class in submodule
# In genenal
# my_app/config/environments/development.rb
Rails.application.configure do
# Settings specified here will take precedence over those in config/application.rb.
# In the development environment your application's code is reloaded on
# every request. This slows down response time but is perfect for development
# since you don't have to restart the web server when you make code changes.
config.cache_classes = false
end