Question

So my Rails controller isn't working (properly) for some reason.

I first noticed something funny when I opened the controller file for the first time.

Vim Sytax Highlighting Pr

Compare this to normal syntax highlighting. (Also notice the overly long name)

Normal Syntax Highlighting

This was the error I got when I tried to create a link in one of my views.

ActionView::Template::Error (undefined method `new_voyage_at_port_log_entries_path' for #<#<Class:0x007fb1c5921a98>:0x007fb1c81a32a0>):

Here's proof that I inserted this in my routes.

resources :voyage_at_port_log_entries

I do have it working by creating manual routes, but that is a little awkward, and I may forsee problems later. Why might ActionView not be working?

Was it helpful?

Solution

DUH! Routes are created for the singular version.

So...

new_voyage_at_port_log_entry_path

works!

BUT...syntax highlighting is still off... Hmmm...not important but weird...probably has a different pluralization engine?

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top