Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I configure my RubyMine with devise gem?

When I use the one in RubyMine I don't see autocompletion for helpers (like current_user, destroy_user_session_path, etc.). It's very bad :( Can someone help me? :)

like image 407
Саша Вульф Avatar asked Oct 29 '14 20:10

Саша Вульф


People also ask

How does devise gem work in Rails?

Devise is the cornerstone gem for Ruby on Rails authentication. With Devise, creating a User that can log in and out of your application is so simple because Devise takes care of all the controllers necessary for user creation ( users_controller ) and for user sessions ( users_sessions_controller ).


1 Answers

Short answer:
You're not doing anything wrong. Right now, it's the best Rubymine can do.

Slightly longer answer:
As you probably know, Ruby can be a very dynamic language. Devise relies heavily on the metaprogramming capabilities of the language. The helpers, such as current_user are generated at runtime, rendering Rubymine's static analysis capabilities ineffective.

Rubymine would need to have special support for Devise and, as far as I know, it just doesn't.

like image 79
Jorge Marques Avatar answered Sep 30 '22 23:09

Jorge Marques