← All extensions

ERB Snippets

v0.1.0 · by enderahmetyurt · added 3 November 2026

Essential ERB snippets for faster development

Snippets

How to install

With Forge Super installed, the button above opens the app on this extension, where you press Install. Nothing is installed until you do.

You can also open the Extensions panel in the app and search for ERB Snippets. The extension's id is erb-snippets.

Don't have Forge Super yet? Download it here.

README

From the extension's repository, written by its authors and not by Mentenaz. See the source.

Zed ERB Snippets

A comprehensive collection of ERB snippets for Zed editor, designed to accelerate ERB development with intelligent autocomplete and placeholder support.

✨ Features

  • 50+ snippets covering all common Rails ERB patterns
  • Smart tab stops - quickly navigate through snippet placeholders with Tab
  • Organized by category - forms, helpers, control flow, Turbo, and more
  • Autocomplete support - snippets appear in Zed's autocomplete menu
  • Proper ERB syntax highlighting - enhanced language support for .html.erb files
  • Auto-closing tags - ERB tags <% %> auto-close as you type
  • Modern Rails support - includes Turbo Frame, Turbo Stream, and latest helpers
  • Zero configuration - works immediately after installation
  • Lightweight - no dependencies, fast loading
  • Well-documented - each snippet includes a description

What's Included ✅ Basic ERB tags (output, execution, comments) ✅ Form helpers (form_with, form_for, all input types) ✅ Link and navigation helpers ✅ Asset management helpers ✅ Control structures (if/else, loops, unless) ✅ Rendering partials and collections ✅ Turbo Frame and Turbo Stream ✅ View helpers (sanitize, truncate, time_ago, etc.) ✅ Flash messages and error handling ✅ Content management (content_for, yield, capture)

📦 Installation

Via Zed Extensions (Recommended)

  1. Open Zed editor
  2. Press Cmd/Ctrl + Shift + P to open the command palette
  3. Type "extensions" and select "zed: extensions"
  4. Search for "ERB Snippets"
  5. Click "Install"

Manual Installation

  1. Clone this repository:

    git clone https://github.com/enderahmetyurt/zed-erb-snippets
    
  2. Copy the extension to your Zed extensions directory:

    • macOS: ~/.config/zed/extensions/
    • Linux: ~/.config/zed/extensions/
    • Windows: %APPDATA%\Zed\extensions\
  3. Restart Zed

Type the prefix and press Tab to expand the snippet.

Example

pe<Tab>  →  <%= | %>

The | represents your cursor position.

📝 Available Snippets

Basic ERB Tags

PrefixOutputDescription
pe<%= %>ERB output tag
pc<% %>ERB execution tag
pco<%# %>ERB comment

Links and Assets

PrefixDescription
ltlink_to helper
ltblink_to with block
imgimage_tag
btbutton_to
apasset_path
sltstylesheet_link_tag
jitjavascript_include_tag

Forms

PrefixDescription
ffwform_with
ffform_for
ftftext_field
ftatext_area
fememail_field
fpwpassword_field
fsbsubmit button
fllabel
fcbcheck_box
frbradio_button
fseselect
fcscollection_select
fhfhidden_field
ffffile_field
fnfnumber_field
fdfdate_field

Control Flow

PrefixDescription
ifif statement
ifeif-else statement
unlunless statement
eacheach loop
eachieach_with_index loop

Rendering

PrefixDescription
rprender partial
rpcrender partial with collection
cfcontent_for
yieldyield

Turbo (Hotwire)

PrefixDescription
tfturbo_frame_tag
tsfturbo_stream_from

View Helpers

PrefixDescription
sfsimple_format
sansanitize
trctruncate
ntcnumber_to_currency
taiwtime_ago_in_words
dotiwdistance_of_time_in_words
plurpluralize
cyccycle

Common Patterns

PrefixDescription
flashflash messages loop
errerror messages display
csrfcsrf_meta_tags

Content Tags

PrefixDescription
ctcontent_tag
tagtag helper
sjsafe_join
capcapture block
provprovide

💡 Tips

  • All snippets include tab stops ($1, $2, etc.) for quick navigation
  • Press Tab to move to the next placeholder
  • Press Shift+Tab to move to the previous placeholder
  • The final tab stop ($0) places your cursor at the end

Example Workflow

ffw<Tab>
  → <%= form_with model: @model do |f| %>
      |
    <% end %>

ftf<Tab>
  → <%= f.text_field :attribute, class: 'form-control' %>

🛠️ Troubleshooting

If snippets don't work:

  1. Check Zed's extension log:

    • Open Command Palette (Cmd+Shift+P / Ctrl+Shift+P)
    • Search for "Zed: Open Log"
    • Look for any errors related to your extension
  2. Verify file paths: Make sure all files are in the correct location

  3. Check JSON syntax: Validate all JSON files

  4. Restart Zed: Sometimes a full restart is needed

  5. Verify file extension: Make sure your file ends with .html.erb

🤝 Contributing

Contributions are welcome! If you have ideas for new snippets or improvements:

  1. Fork the repository
  2. Create a feature branch
  3. Submit a pull request

🙏 Acknowledgments

Built for the Ruby on Rails community using Zed editor.


Enjoy coding with Rails ERB Snippets! 🚀

If you find this extension helpful, please star the repository and share it with other Rails developers.