Longitude
SELECT ST_X(the_geom) FROM myTable;
Latitude
SELECT ST_Y(the_geom) FROM myTable;
CarrierWave.configure do |config| | |
if Rails.env.test? || Rails.env.cucumber? | |
config.storage = :file | |
config.enable_processing = false | |
elsif ENV.key?('S3_KEY') | |
config.storage = :fog | |
# let's Carrierwave work on Heroku | |
config.cache_dir = Rails.root + '/tmp/uploads' |
Devise.setup do |config| | |
config.secret_key = ENV.fetch('SECRET_KEY_BASE') | |
# ==> Mailer Configuration | |
config.mailer_sender = ENV.fetch('DEFAULT_SENDER') | |
config.mailer = 'Devise::Mailer' | |
# ==> ORM configuration | |
require 'devise/orm/active_record' |
r |
currently created a helper method to extract the core date from the string returned by the gem's local_date method | |
in views/ | |
<%= extract_date(local_date(workflow.created_at, CommonConstants::DATE_FORMAT_LONG)) %> | |
# Parse the string generated by local_time gem | |
# Expectation : | |
# "<time data-format=\"%B %e, %Y\" data-local=\"time\" datetime=\"2015-10-28T11:19:54Z\">October 28, 2015</time>" | |
def extract_date(date_string) | |
date_string.split('>').pop.split('</')[0] rescue '' |
# ApplicationController | |
before_action :configure_permitted_parameters, if: :devise_controller? | |
protected | |
def configure_permitted_parameters | |
devise_parameter_sanitizer.for(:sign_up) { |u| u.permit(:username, :email, :password, :password_confirmation, :remember_me) } | |
devise_parameter_sanitizer.for(:sign_in) { |u| u.permit(:login, :username, :email, :password, :remember_me) } | |
devise_parameter_sanitizer.for(:account_update) { |u| u.permit(:username, :email, :password, :password_confirmation, :current_password) } | |
end |
## Enabling postgis | |
``` | |
psql=# create extension postgis; | |
CREATE EXTENSION | |
``` | |
migration for enabling postgis | |
``` |
migration commands
$ rake db:migrate:up VERSION=20080906120000
I'm trying to install middleman but it crashes when trying to install version 1.0.8 of eventemitter. | |
I'm running OSX 10.11 El Capitan. | |
I use rbenv and have tried ruby 2.1.7 and 2.2.0 | |
brew link openssl --force did the trick. Thanks!! |