https://www.sitepoint.com/deploy-your-rails-app-to-aws/
Arquivo da categoria: Rails
Deploy Your Rails App
The Modular Monolith: Rails Architecture
How to use the “number_to_currency” helper method in the model rather than view?
class MyPresenterOrViewModel
def some_field
helper.number_to_currency(amount, :precision => 0)
end
private
def helper
@helper ||= Class.new do
include ActionView::Helpers::NumberHelper
end.new
end
end
Cron jobs in Rails: A simple guide to ACTUALLY using the Whenever gem (now with tasks!)
Rails Assets
cancancan load_and_authorize_resource not model
skip_load_and_authorize_resource
authorize_resource :class => false
the font-awesome font bundled as an asset for the rails asset pipeline
ruby on rails value Rails reset ALL Postgres sequences?
ActiveRecord::Base.connection.tables.each do |table|
result = ActiveRecord::Base.connection.execute("SELECT id FROM #{table} ORDER BY id DESC LIMIT 1") rescue ( puts "Warning: not procesing table #{table}. Id is missing?" ; next )
ai_val = result.any? ? result.first['id'].to_i + 1 : 1
puts "Resetting auto increment ID for #{table} to #{ai_val}"
ActiveRecord::Base.connection.execute("ALTER SEQUENCE #{table}_id_seq RESTART WITH #{ai_val}")
end