Mycowriter Demo
Interactive autocomplete for fungal genus and species names
How to use: Type a genus name starting with a capital letter (4+ characters). Click your selection from the dropdown. Continue typing the species name to get species suggestions for that genus. The complete binomial will be inserted at your cursor position.
Try It Now
Try These Examples:
- Step 1: Type "I found an Agar" - wait for dropdown
- Step 2: Click "Agaricus" from the dropdown
- Step 3: Continue typing: "campes" - wait for species dropdown
- Step 4: Click "campestris" - see full binomial: "Agaricus campestris"
📝 Output Format
The gem inserts plain text (e.g., "Agaricus campestris") without HTML formatting.
You can add italics in your application via CSS or by wrapping the text with <em> tags in your controller/helper.
The gem helps you spell complex taxonomic names correctly while writing. Perfect for articles, descriptions, field notes, and research papers.
How to Integrate Into Your Rails App
1. Add to your Gemfile
gem 'mycowriter'
2. Install and setup
bundle install
rails generate mycowriter:install
3. Mount the engine in routes.rb
mount Mycowriter::Engine => "/mycowriter"
This mounts the Mycowriter engine, adding its autocomplete API endpoints (/mycowriter/autocomplete/genera and /mycowriter/autocomplete/species) to your application's routes.
4. Use in your text fields
<div data-controller="inline-autocomplete"
data-inline-autocomplete-genus-url-value="<%= mycowriter.genera_autocomplete_path %>"
data-inline-autocomplete-species-url-value="<%= mycowriter.species_autocomplete_path %>"
data-inline-autocomplete-min-value="4">
<%= f.text_area :body,
data: {
inline_autocomplete_target: "textarea",
action: "input->inline-autocomplete#onInput keydown->inline-autocomplete#onKeydown"
},
class: "form-textarea" %>
<div data-inline-autocomplete-target="dropdown" class="hidden"></div>
</div>
Provides inline autocomplete for fungal genus and species names as you type in textareas. Perfect for articles, descriptions, and field notes.
Features
🔍 Smart Search
Intelligent ranking: exact matches first, then prefix, then substring matches
⚡ Debounced Queries
150ms delay reduces server load while maintaining responsiveness
🎯 Taxonomic Accuracy
Validates genus capitalization per binomial nomenclature standards
♿ Keyboard Navigation
Full arrow key and Enter/Escape support for accessibility
🔒 Authentication Ready
Integrates seamlessly with Devise and Pundit authorization
🎨 Customizable
Configure minimum characters, limits, and styling via initializer