-
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' # Define o locale padrão como pt-BR | |
config.i18n.available_locales = ['en', :'pt-BR'] # Adiciona pt-BR aos locais disponíveis | |
config.time_zone = 'La Paz' | |
config.active_record.default_timezone = :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
# Removendo o carregamento onhover de links | |
<meta name="turbo-prefetch" content="false"> | |
# Method Delete link_to no turbo | |
<%= link_to logout_path, class: "nav-link", data: { turbo_method: :delete, turbo: true } do %> | |
# COMANDOS | |
rails new appname -d postgresql | |
rails new appname --api |
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 <[email protected]> | |
# Version: 1.7.0 - 02/01/2025 | |
#--------------------------------------------------------------------------------------- | |
# | |
# 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)