11

I'm using Rubymine (5.4.3.2.1) for Hartl's RoR tutorial and I'm having some troubles with path helpers. root_path works just fine but rubymine says 'cannot find xxxx_path' for the rest actions in my controller.

Rspec and Rails server are working just fine with those same path helpers!!

My routes.rb:

SampleProject::Application.routes.draw do
  get "users/new"

  root 'static_pages#home'
  match '/signup',  to: 'users#new', via: 'get'
  match '/help', to: 'static_pages#help', via: 'get'
  match '/about', to: 'static_pages#about', via: 'get'
  match '/contact', to: 'static_pages#contact', via: 'get'
end

I also tried to use get instead of match but that didn't help.

Onni Hakala
  • 563
  • 4
  • 18
  • RubyMine addict here - what do you mean "cannot find xxxx_path"? What do you care what the editor says, if the code works and the tests pass? – Phlip Nov 13 '13 at 16:11
  • 6
    Well that's what I thought and continued. But still I don't think it's bad to have tools that help to recognize typos and errors right away. So when I can't know for sure is it mine fault or rubymine it's kinda useless – Onni Hakala Nov 13 '13 at 16:30
  • 3
    And I meant that rubymine can't find those helpers (e.g. controller#about) -> So it can't understand usage of 'match' in routes -> So I can't use all of the good navigational features of rubymine – Onni Hakala Nov 13 '13 at 16:33

1 Answers1

1

Ruby is a dynamic language and therefore some things are hard to parse intelligently for the IDE.

However showing routes and helpers like "people_path" etc should work, but you must restart the server if you change it!

Peter Andersson
  • 1,947
  • 3
  • 28
  • 44
  • 1
    even for the latest version, it could not recognise well. see my post: http://stackoverflow.com/questions/29618038/rubymine-can-not-recognize-path – LiangWang Apr 14 '15 at 02:11