Skip to content

Instantly share code, notes, and snippets.

Avatar

Sovanlandy sovanlandy2

View GitHub Profile
View gist:5f2e4b9bfd6410c6bdc7
# Validate the length of the string
validates_length_of :username, :minimum => 5, :maximum => 255, :allow_blank => false
# or
validates :password, :length => { :minimum => 6 }, allow_blank: true
# Validate paperclip attachment
validates_attachment :profile_image,
@sovanlandy2
sovanlandy2 / set environment of app on heroku
Last active Aug 29, 2015
How to set heroku app environment to staging or production
View set environment of app on heroku
heroku config:add RAKE_ENV=staging --remote staging
heroku config:add RAILS_ENV=staging --remote staging
# if you have parity gem installed:
staging config:add RAKE_ENV=staging
staging config:add RAILS_ENV=staging
# check out parity gem, designed specifically for heroku https://github.com/croaky/parity
You can’t perform that action at this time.