tpope / vim-rails

rails.vim: Ruby on Rails power tools
http://www.vim.org/scripts/script.php?script_id=1567
4.11k stars 384 forks source link

gf doesn't singularize for a render of instance variable with Rails-connected partial #499

Closed seanhogge closed 6 years ago

seanhogge commented 7 years ago

For instance, if I have:

<%= render @books %>

then gf on the line (or on @books) looks for _books.html.erb in the correct directory. However, Rails wants _book.html.erb and does all its connector magic to controller and model such that the partial needn't have the loop, just the markup and insertion of the columns one wishes to display.

Unrelated: Thanks for the amazing work, this plugin has made learning Rails a delight.

tpope commented 7 years ago

This will require some juggling to fix, as some helper logic treats render @books and render 'books' identically.

seanhogge commented 7 years ago

Yeah, I was afraid of that. Another case of the price of convenience, I suppose.

I probably can't help much on the extensive codebase you're intimately familiar with, but if there is anything I can do that would be of use, I'm happy to chip in where I can.

tpope commented 6 years ago

Fixed this a little while back and forgot to close the issue.