Essential JavaScript Links
I no longer mantain this list. There are lots of other very comprehensive JavaScript link lists out there. Please see those, instead (Google "awesome JavaScript" for a start).
ruby '2.7.1' | |
gem 'rails', github: 'rails/rails' | |
gem 'tzinfo-data', '>= 1.2016.7' # Don't rely on OSX/Linux timezone data | |
# Action Text | |
gem 'actiontext', github: 'basecamp/actiontext', ref: 'okra' | |
gem 'okra', github: 'basecamp/okra' | |
# Drivers |
I no longer mantain this list. There are lots of other very comprehensive JavaScript link lists out there. Please see those, instead (Google "awesome JavaScript" for a start).
# Stick this in your home directory and point your Global Git config at it by running: | |
# | |
# $ git config --global core.attributesfile ~/.gitattributes | |
# | |
# See https://tekin.co.uk/2020/10/better-git-diff-output-for-ruby-python-elixir-and-more for more details | |
*.c diff=cpp | |
*.h diff=cpp | |
*.c++ diff=cpp | |
*.h++ diff=cpp |
class PostsController < ActionController::Base | |
def create | |
Post.create(post_params) | |
end | |
def update | |
Post.find(params[:id]).update_attributes!(post_params) | |
end | |
private |
module MyApp | |
class Application < Rails::Application | |
require Rails.root + 'lib/custom_public_exceptions' | |
config.exceptions_app = CustomPublicExceptions.new Rails.public_path | |
end | |
end |
The latest release notes is available at http://edgeguides.rubyonrails.org/3_2_release_notes.html
Speed up development by only reloading classes if dependencies files changed. This can be turned off by setting config.reload_classes_only_on_change
to false. José Valim
New applications get a flag config.active_record.auto_explain_threshold_in_seconds
in the environments configuration files. With a value of 0.5 in development.rb, and commented out in production.rb. No mention in test.rb. fxn
Add DebugExceptions middleware which contains features extracted from ShowExceptions middleware José Valim
For a while, I have felt that the following is the correct way to improve the mass assignment problem without increasing the burden on new users. Now that the problem with the Rails default has been brought up again, it's a good time to revisit it.
When creating a form with form_for
, include a signed token including all of the fields that were created at form creation time. Only these fields are allowed.
To allow new known fields to be added via JS, we could add:
task :glyphs => :environment do | |
glyphs = [] | |
glyphs_hash = {} | |
longest_name = 0 | |
Dir.glob(Rails.root.join("app", "assets", "images", "glyphicons", "*.png")) do |path| | |
width, height = `identify -format "%wx%h" #{path}`.strip.split(/x/) | |
# glyphicons_083_random.png | |
# glyphicons_083_random@2x.png | |
# glyphicons_halflings_047_bold.png |