-
Coffee and another gems like jquery is installed on yarn and imported on app/javascripts/application.js
rails webpacker:install:coffee
References
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
# Artigo ogirinal por JORGE VILAÇA | |
# https://jorgevilaca.wordpress.com/2012/03/06/nacionalizando-rails-para-pt-br/ | |
# config/application.rb | |
config.i18n.default_locale = 'pt-BR' | |
config.time_zone = 'La Paz' | |
config.active_record.default_timezone = :local | |
# config/locales/pt-BR.yml |
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
# COMANDOS | |
rails new appname -d postgresql | |
rails new appname --api | |
gem install rails -v 6.1.4.4 | |
rails _6.1.4.4_ new myapp | |
# Rails sem webpack | |
rails new app-name --skip-webpack-install --skip-javascript |
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
#!/bin/bash | |
#--------------------------------------------------------------------------------------- | |
# Script to install rbenv, Ruby, nodejs and yarn | |
# Source: https://gist.github.com/alexishida/655fb139c759393ae5fe47dacd163f99 | |
# | |
# Author: Alex Ishida <alexishida@gmail.com> | |
# Version: 1.6.4 - 23/08/2024 | |
#--------------------------------------------------------------------------------------- | |
# | |
# HOW TO INSTALL A SCRIPT |
To enable the precompilation of all non.js/.css assets within vendor/assets
just add this to config/initializers/assets.rb
:
Rails.application.config.assets.precompile << Proc.new { |path, fn| fn =~ /vendor\/assets/ && !%w(.js .css).include?(File.extname(path)) }
Be aware that this will precompile ALL non .js/.css assets that you have there, some plugins or libraries might have .txt or other files around, and those would end up into your precompiled list also.
If you need to precompile images only, you could use this:
Rails.application.config.assets.precompile += %w(*.png *.jpg *.jpeg *.gif)