Rubymine related symbols

已回答

```rb
controllers/factory_controller.rb
```
```rb
views/factories/…
```
are related symbols. 
It would be great if
```rb
forms/factories/…
```
could also be related
 

0

Hello Quentin,

That doesn't seem to be an official Rails directory, and RubyMine supports the standard directories. Could you please specify why you use it?

0

Hello Olga, and thank you for your quick reply, as always.

Rails provides several default directories under /app such as controllers, models, and views.

In addition to these, many common gems and patterns introduce extra directories that Rails (via Zeitwerk) also treats as top-level autoloadable resources. Examples include:

forms, decorators, services, observers, policies, serializers, etc.

All these resources are closely related, and having a way to quickly navigate between them would be extremely helpful.

0

Could you please specify which specific gem or documented Rails pattern defines this directory in your project?
If it's not tied to an official Rails feature or a RubyMine-supported gem, we'd suggest writing your own plugin for the custom support.

0

Thanks for your answer. I will try to write a plugin then. 

Popular gems that define or use non-official Rails directories:

  • Reform → app/forms
  • Trailblazer → app/forms, app/operations, app/workflows
  • dry-validation → app/forms, app/validators
  • Interactor → app/services, app/interactors
  • ActiveInteraction → app/services, app/forms
  • Pundit → app/policies
  • ActionPolicy → app/policies
  • ActiveModelSerializers → app/serializers
  • JSONAPI::Serializer → app/serializers
  • Blueprinter → app/serializers
  • Draper → app/decorators, app/presenters
  • CarrierWave → app/uploaders
  • Shrine → app/uploaders
  • ViewComponent → app/components
  • Phlex → app/components
  • Sidekiq → app/workers (historically)
  • Resque → app/workers
  • rails-observers → app/observers
  • Wisper → app/observers
  • RailsEventStore → app/queries (CQRS)
  • QueryObject pattern (community) → app/queries


     
0

Thank you for the provided details. It seems that at the moment we don’t provide support for these gems, so a custom plugin would be the best option here. We have a feature request for Trailblazer though, so please add your vote there: https://youtrack.jetbrains.com/issue/RUBY-20147

 

0

Thanks for your answer. I've vibe-coded the plugin, and you it daily at work. Maybe it can help others: https://github.com/gaultierq/rubymine-rails-related-resources

0

请先登录再写评论。