Alemaño

@elalemanyo.bsky.social

Full-Stack Web Developer at @DotRubyDev 🧱 http://RailsbootUI.com Rails View Components for Bootstrap

AI-generated code comments keep reminding me of WYSIWYG: What You See Is What You Get. If the comment only repeats what the next line of code already says, it’s not documentation — it’s a subtitle. 😅 The best comments explain why, not what.

Bild

TIL: Rendering multiple form_with forms on the same page can generate duplicate input IDs 😬 That led to a confusing Turbo behaviour: after an autosubmit, focus was restored to the first matching element, causing page jump to the top. Fix: add a namespace to generate unique IDs.

Bild

I built csspin-rails — like importmap-rails, but for CSS. Pin CSS packages from npm, vendor them into vendor/assets/stylesheets, and use them. No Node.js needed. Not sure if I’m the only one who needed this 😄 Feedback welcome 👇 github.com/elalemanyo/c...

GitHub - elalemanyo/csspin-rails: Importmap-style CSS dependency management for Rails. Pin, vendor, and manage styles without Node.

Importmap-style CSS dependency management for Rails. Pin, vendor, and manage styles without Node. - elalemanyo/csspin-rails

github.com

CSS doesn't natively handle truncating text from the middle. Inspired by @wesbos.com , I built a Stimulus controller for it. Super useful for long URLs & filenames. Also using Cheng Lou pretext for smarter truncation 🙏 Super useful for long URLs & filenames 👇 github.com/elalemanyo/s...

GitHub - elalemanyo/stimulus-truncate-text-from-middle: Stimulus controller for middle text truncation, powered by @chenglou/pretext

Stimulus controller for middle text truncation, powered by @chenglou/pretext - elalemanyo/stimulus-truncate-text-from-middle

github.com

Need an extra email address but don't want to create a new account? Most providers support plus addressing → just add +something before the @. All emails still arrive in your inbox, and you can filter them easily. Example: bob+needanothermail@gmail.com 📬

Redesigning a Rails app? 🚀 We discovered an underrated feature: :variants. With just one magic suffix you can run old & new layouts in parallel — no JS, no cookies, just Rails ✨ Full write-up 👉 dotruby.com/articles/eas...

Easy Redesign in Rails: Run Old and New Side by Side with :variants

Rails variants are usually used to serve different views for devices — but you can use them for much more, like running a redesign side by side.

dotruby.com

🚨 Rails tip: Appending query params with concat or + "?..." can break your URLs — especially if the URL already includes parameters. Instead of risking invalid or double ?s, use a proper helper that merges params safely. 👇

Bild

💡 I needed to check if a string is a valid app path in my Rails app — surprisingly, couldn’t find a built-in way. So I wrote a small helper method. Sharing in case it helps someone — or if there’s a better way? 🤔👇

Bild

I remembered today and thought I'd share: You can use .many? instead of count > 1 — more readable and sometimes faster! 💡 On relations: uses LIMIT 2 ⚠️ On associations: loads all records

Bild

Anchor links not scrolling correctly in your Rails app? Turbo Drive intercepts clicks and replaces page content via fetch (not a full page reload) — and that breaks native #anchor scrolling. Fix it with data-turbo="false" Tamed the Turbo — anchor away! ⚓

Bild

Pluralizing model names in Rails with proper i18n — there's a helper for that. I wrote a small helper that uses model_name.human(count: ...) to do it the right way — fully i18n-ready. Simple, readable, and it works with any model as long as it's been translated 😉

Bild

💡 Clean Rails views with conditional wrapping? Use conditional_tag to wrap content in a tag only if a condition is true. No more messy if blocks in ERB. Just clean, readable templates. Discovered this gem thanks to @scarfacedeb 🙌

Bild