Selenium does not speak SSL because it uses WEBrick that doesn't. When you use Selenium for Cucumber scenarios that...
Presentation about optimizing Ruby on Rails apps. From Nico Hagenburger (homify's lead frontend developer...
When ActiveRecord child objects are autosaved in Rails...
Chrome extension that shows all info from your rails log (like parameters, response times, view rendering times, DB requests) inside a chrome panel...
...even though the image data was stripped. # spec/support/vcr.rb VCR.configure do |config| config.cassette_library_dir = Rails.root.join('spec', 'vcr') config.hook_into :webmock config.filter_sensitive_data(' ') do Base64.strict_encode64("#{Rails.application.credentials.ollama_basic_auth_user...
...Rails.application.credentials.ollama_basic_auth_password!}") end config.ignore_localhost = true scrub_base64_images = lambda do |body| return body if body.blank? json = JSON.parse(body) if json.is_a?(Hash) && json['messages'].is_a?(Array...
...to be released when the block ends. Example: RSpec::Mocks.with_temporary_scope do allow(Rails).to receive(:env).and_return('production'.inquiry) puts Rails.env # prints "production" end puts Rails.env # prints...
We can now plug into every facet of the Rails jQuery UJS adapter, binding to custom events, and even customizing internal functions, without hacking or monkey-patching the rails.js file...
Thanks to habits engrained by Rails 2’s link_to_remote and remote_form_for, we expect that Rails 3 would also handle the AJAX response for our remote links...
In a great post about named routes in Rails, path vs. url, Viget Labs ponders which variant is best used. Most often we use foo_path, which when used in...
...Rails URL helpers will generate a relative path, where foo_url generates a full URL. In most cases the path makes most sense, but not always...
The Rails router has been written and rewritten at least four times2, including a recent rewrite for the upcoming Rails 3. The syntax is now more concise. But never mind...
...ve been made aware of people inside US Government organizations using my Ruby on Rails Security presentation as an excuse to limit Ruby on Rails adoption and projects inside those...
...are verified. Note that this is enabled by default when you are using rspec-rails along with verifying doubles. So if you really need to verify some dynamically defined methods...
...for storing time of day in the format hh:mm:ss, neither Ruby nor Rails themselves offer an elegant way to deal with day times. Time and DateTime both handle...
options: { search: 'window.toString() === \'[object GjsGlobal]\'', replace: 'window.toString() === \'[object Window]\'' } }] }) Fix for ESBuild / jsbundling-rails Add the package esbuild-plugin-text-replace to your package.json. Now add the following plugin...
...consume GBs of memory bringing down our servers. The solution Just use .preload instead. Rails will use separate queries to preload the data. This cannot lead to a cross product...
Learning Rails for the first time should be fun, and Rails for Zombies allows you to get your feet wet without having to worry about configuration. You'll watch five...
...videos, each followed by exercises where you'll be programming Rails in your browser...
Rails 8 provides a new way of doing things after the current transaction, without defining a model "global" after_commit callback. def do_something update_column(:foo, "bar")
...update_column(:foo, "bar") ActiveRecord::Base.current_transaction.after_commit { send_email(foo: "bar") } ActiveRecord::Base.current_transaction.after_rollback { Rails.logger.warn("rollback") } # after_rollback is also supported end If you call current_transaction.after_commit in a nested...
If you get an error message like that you are missing the Aspell files a specific language:
sudo gem install rails --version="=1.2.3" rails _1.2.3_ new-project-folder
...changelog_path = File.expand_path('../CHANGELOG.md', __dir__) Ruby < 2.0 changelog_path = File.expand_path('../../CHANGELOG.md', __FILE__) Rails changelog_path = Rails.root.join('CHANGELOG.md...
Declare an enum attribute where the values map to integers in the database, but can be queried by name.
I recently had a need to demonstrate a data-heavy application to potential customers. Demonstrating the application with bogus numbers...
...only list versions that are allowed by your Gemfile requirements (e.g. does not show rails update to 6 if your Gemfile has the line gem 'rails', '~>5.2'). I also experienced...
...events and origin all apply, including your own event listeners on the link and Rails' [data-method] and [data-confirm]. A link with [download] downloads its file, and a link...
...attribute, like links and forms do. It is an alias of [up-confirm], so Rails helpers like link_to or button_to work without changes. If your app handles [data...