|
|\_ app
|...
|\_ docker
| |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Install tmux on Centos release 6.5 | |
# install deps | |
yum install gcc kernel-devel make ncurses-devel | |
# DOWNLOAD SOURCES FOR LIBEVENT AND MAKE AND INSTALL | |
curl -OL https://github.com/downloads/libevent/libevent/libevent-2.0.21-stable.tar.gz | |
tar -xvzf libevent-2.0.21-stable.tar.gz | |
cd libevent-2.0.21-stable | |
./configure --prefix=/usr/local |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Additional translations at http://github.com/plataformatec/devise/wiki/I18n | |
# Translation by William Wong Garay (willywg) https://github.com/willywg | |
es: | |
errors: | |
messages: | |
expired: "ha expirado, por favor solicita una nueva" | |
not_found: "no se encontró" | |
already_confirmed: "ya fue confirmado, por favor intenta iniciar sesión" | |
not_locked: "no estaba bloqueado" |
http://www.zhlwish.com/2012/07/23/rails-activesupport-concern/
# autoload concerns
module YourApp
class Application < Rails::Application
# config.autoload_paths += %W(
# #{config.root}/app/controllers/concerns/
# #{config.root}/app/models/concerns/
# )
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function number_to_currency(number, options) { | |
try { | |
var options = options || {}; | |
var precision = options["precision"] || 2; | |
var unit = options["unit"] || "\u20AC"; | |
var separator = precision > 0 ? options["separator"] || "." : ""; | |
var delimiter = options["delimiter"] || ","; | |
var parts = parseFloat(number).toFixed(precision).split('.'); | |
return unit + number_with_delimiter(parts[0], delimiter) + separator + parts[1].toString(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. Desinstalar todo rastro de ImageMagick e ImageMagik-devel | |
sudo yum remove ImageMagick | |
sudo yum remove ImageMagick-devel | |
2. Instalar complementos previos: | |
sudo yum install tcl-devel libpng-devel libjpeg-devel ghostscript-devel bzip2-devel freetype-devel libtiff-devel | |
3. Bajarse el ImageMagick desde las fuentes: | |
mkdir ~/sources | |
cd ~/sources |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# /app/helpers/devise_helper.rb | |
module DeviseHelper | |
def devise_error_messages! | |
return '' if resource.errors.empty? | |
messages = resource.errors.full_messages.map { |msg| content_tag(:li, msg) }.join | |
sentence = I18n.t('errors.messages.not_saved', | |
count: resource.errors.count, | |
resource: resource.class.model_name.human.downcase) |
I recently completed our upgrade to Rails 4. Below are various notes and links that may help you if you are upgrading your application to Rails 4. YMMV.
There is a good Rails Guide on upgrading, with a specific section on upgrading from Rails 3.2 to Rails 4.0. First, a bit about our specific application and the technologies used, pre-Rails 4 upgrade:
- Rails 3.2.14
- Ruby 2.0.0-p247
NewerOlder