Rapidfire and development

I implemented Devise and followed the instructions for installing Rapidfire and for the application controller I have

def current_user
  current_user  #rb:7
end

def can_administer
  true # just for right now...
end

but on the page I realized that something went wrong, and if I look in the console, it says

ActionView::Template::Error (stack level too deep)
app/controllers/application_controller.rb:7

which is a string current_user.

Can someone tell me what is going on?

0
source share
1 answer

You create a method called current_user, and you return a value current_user.

Ruby does not require you to use parentheses when calling methods.

current_user

is the same as

current_user()

You call the function current_useragain and again.

There is no reason for you to define a method named current_userwhen devise gives it to you.

+2

Source: https://habr.com/ru/post/1528809/


All Articles