slate.com

Nice article to educate your non-geek girlfriend/boyfriend about the joys of programming.

jetbrains.com

You can quickly access views that belong to a controller by using the tiny "page with arrow" icon in the...

johnnunemaker.com

...row becomes expensive The linked article shows how to create a partial index with Rails...

travisonrails.com

You set a flash message and it shows up as it should. However, it is displayed again the next time...

...card teaches the React basics you need for that — components, state, effects, talking to Rails — and how to mount an island from an Unpoly compiler. It is not about building...

...you can explain why effects need cleanup. You can let an island talk to Rails through a small JSON API, both reading and writing. You can mount and unmount a...

git_source(:github) { |repo| "https://github.com/#{repo}.git" } ruby "2.7.6" gem "rails", "~> 7.0.6" gem "sqlite3", "~> 1.4" gem "puma", "~> 5.0" This blocks automatic updates of rails, sqlite3 and puma...

git_source(:github) { |repo| "https://github.com/#{repo}.git" } ruby "2.7.6" gem "rails" gem "sqlite3" gem "puma" All gems are easily updateable with bundle update Good source "https://rubygems.org...

blog.bitcrowd.net

To make the RSpec matcher of the authorization solution Consul work with Rspec 2.x read the following blog post...

api.rubyonrails.org

{ page_count: match[1].to_i } else {} end end rescue StandardError => e Rails.logger.error("PdfAnalyzer failed to parse metadata: #{e.message}") {} end def self.analyze_later? true # default end end # config/initializers/active_storage.rb...

...Rails.application.config.active_storage.analyzers.append PdfAnalyzer # db/migrate/xxxxx_add_pdf_analyzer.rb class AddPdfAnalyzer < ActiveRecord::Migration[8.0] def up pdf_blobs = ActiveStorage::Blob.where(content_type: 'application/pdf') # Mark all existing PDF blobs as to-be-analyzed-again pdf_blobs.find_each do...

...to check all traits for mistakes. This behavior is likely to be caused by Rails' autoloading...

makandra dev

In the ruby shell (IRB) and rails console the return value of the previous command is saved in _ (underscore). This might come in handy if you forgot to save the...

nt.ntnu.no

...Ruby couterpart. Thus, it does a great job as YAML-doc, e.g. when writing Rails locale files. Did you know that ... << is a merge key (similar to & in SASS)

makandra dev
sitepoint.com

A look at Prawn, PDFKit, and Wicked PDF

lists.ruby-lang.org

...on our radar for a while. They seem to have made significant progress running Rails, reducing start-up time and becoming runtime-independent of the JVM. Also see Running Optcarrot...

makandra dev
skillsmatter.com

With Rails 4, Concerns have become the “official” solution to the big-models problem. However, there’s a fair amount of controversy about this topic in the community. Not everyone...

...problem of AR models becoming too big. In this talk we will see what Rails Concerns are and how can we use them to keep our models fit. More interestingly...

...lot more gems than you think. E.g. when you do this: bundle update cucumber-rails ... you might think this will only update cucumber-rails. But it actually updates cucumber-rails...

...breaking API changes. Which is all the time. In the example above updating cucumber-rails will give you Capybara 2.0 (because capybara is a dependency of cucumber-rails), which will...

content_type_1.match(/\Aimage\/(jpeg|png)\z/) # => nil content_type_2.match(/\Aimage\/(jpeg|png)\z/) # => Rails Newer Rails explicitly warns you, when you use ^ and $ in validations with a regular expression...

...t say is_a?(ActiveRecord::NamedScope::Scope) because that is no longer true in Rails 3 and also doesn't match unscoped ActiveRecord classes themselves (which we consider scopes for...

If you have a file that looks like a precompilation fingerprint, the Rails asset pipeline will not see it. So don't have filenames like this: 8e21264d-f678-4005-b90c-8d8288a0d179.ttf

Say you want to allow users to emphasize some string, but the whole markdown thing would be far too much...

...remember to set your values with field=#{quoted_true} and field=#{quoted_false}. The Rails methods quoted_false and quoted_true return the correct boolean representations for your database...

...we're using building some of our sites using static site generators instead of Rails. You should talk about: Ease of development Security issues and maintenance costs Read through the...

What can't it do? What parts do you know from Rails? Practice Checkout the repo for the makandra blog Start the preview server Make some changes...

...to iterate over every Monday in a range of Dates. If you are using Rails or ActiveSupport, calling step without a block will return an array of matching elements...

...add support for parallel tests. You can easily do that by setting config.root: config.root = "#{Rails.public_path}/system/#{Rails.env}#{ENV['TEST_ENV_NUMBER']}".freeze For debugging purposes (e.g. trying to hunt...

...separate environment. You you could read from an ENV variable instead of using your Rails.env. Suggested configuration In total, here is a suggested configuration that you can put into config/initializers/carrierwave.rb...

...but give sub-classes a way to override values without affecting the parent class. Rails has many helpers for this such as class_attribute and class_inheritable_accessor. Unfortunately their...

...semantics are hard to understand, the helpers available differ for different versions of Rails and the behavior is subtly different. Make sure you read and understand the API before using...