Creează un cont pentru a te abona la acest blog și a-i urmări articolele pe pagina Lectură.
-
This is a guest collaboration with Stephen Margheim, creator of High Leverage Rails, a video course on building high-quality Rails applications with the power and simplicity of SQLite, HTML, and CSS.
-
This is a guest collaboration with Jesper Christiansen, a long-time fan of most things Ruby on Rails.
-
Event sourcing is a jargon filled mess that is unapproachable to many developers, often using five dollar words like “aggregate root” and “projections” to describe basic concepts.
-
Mailers are a feature used in literally every Rails application.
-
Rails enums are a great way to model things like a status on an ActiveRecord model.
-
There are many tutorials about how to get started with Hotwire and how to use the individual pieces.
-
In Hotwire applications, you need to lean more on the fundamentals of CSS and HTML.
-
Keyboard shortcut support for actions is now built-in to Stimulus 3.2!
-
The dom_id helper in Rails is over a decade old, but has proven to be an invaluable concept in Hotwire.
-
Sometimes you need a little sprinkle of JavaScript to make a tiny UX improvement.
-
If you’ve built UI elements with StimulusJS before, you’ve certainly written code to show or hide an element on the page.
-
When building features that accept user-generated content, you may need to display dynamic content based on what the user specifies.
-
Environment variables are a great way to configure your Rails apps.
-
One of the most common Rails tips is to back up your ActiveRecord model validations with database level constraints.
-
It’s always best to follow a systematic approach when trying to speed up slow code.
-
A common question you may want to answer on user-input data is: what values have been entered and how many times is each one used?
-
In almost all email programs, you can add a display name before your email address like so: To: Matt Swanson <matt@example.com> It’s a small touch, but it is a more human-readable way of addressing an email.
-
Custom Rails helpers modules are often overlooked, but they can be a great option for building lightweight components and reducing boilerplate in your Stimulus controllers.
-
Often you’ll have an application screen like this: After editing information about an employee, you’ll redirect back to the Company Directory page.
-
Hotwire is a new suite of frontend tools from Basecamp for building “reactive Rails” apps while writing a minimal amount of JavaScript.
-
GitHub Actions is an automation platform that you run directly from inside a GitHub repository.
-
If you’re trying to write a tricky ActiveRecord query that includes joins, complex where clauses, or selecting specific values across tables, it can be hard to remember every part of the ActiveRecord DSL.
-
One of the best parts about ActiveRecord is the chainable query interface: Post.includes(:comments) .where(published: true) .where(author: Current.user) .order(:name) To take advantage of this strength and give you flexibility in your code, always…
-
It’s a great idea to make your database and application validations match.
-
Breadcrumbs are a common UI pattern in most software applications.
-
If you follow a strict REST / nested resources approach to building your Rails app, you might get sick of repeating common controller actions.
-
Sometimes want to skip certain validations on your database models.
-
You can’t prove a negative, but what about querying a database for a negative?
-
Sometimes a feature in your application will involve a back-and-forth between multiple users.
-
Rails has a great, expressive term called pluck that allows you to grab a subset of data from a record.
-
When it comes to compare dates, for some reason my brain really struggles.
-
One reason I love writing Ruby is that it’s optimized for programmer happiness.
-
Writing blog posts in Markdown is just great.
-
Heroku Dataclips enable you to create SQL queries for your Heroku Postgres databases and share the results with colleagues, third-party tools, and the public.
-
It’s common to use environment variables to configure external services or other options in a Rails app.
-
Ever get frustrated trying to search through code on GitHub?
-
A common practice in Rails apps is to extract logic into plain-old Ruby objects (POROs).
-
The Rails helper excerpt can extract a chunk of text that matches a certain phrase, no matter where in the string it is.
-
We’re all familiar with the classic Rails link_to helper.
-
Sometimes you need to keep track of how many times you’ve looped when rendering some views, for instance to alternate background colors to create a “striped” table. <!
-
Use the Rails highlight helper to wrap search result matches in <mark> tags.
-
This is a guest collaboration with Pascal Laliberté, author of Modest JS Works, a short online book for those who want to write modest JavaScript, and then focus on all the other stuff that matters in building an app.
-
Hacktoberfest is a month long event that encourages developers to contribute to open source – submit four valid pull requests and you win a tshirt.
-
Somewhere along the way toward our current JavaScript hellscape, programmers decided that HTML was over.
-
We write a lot of JavaScript at Basecamp, but we don’t use it to create “JavaScript applications” in the contemporary sense.
-
“So, uh, is it okay to deploy this?”
-
As the weather warms up, I get energized to give my codebase a spring cleaning.
-
In case you don’t like reading (Feb 2020 - Indy.rb Meetup) In every non-trivial application you’ll have to do something that is just slow.
-
As time goes by, you’ll need to change the data model for your software.