Rapidfire and Devise

人盡茶涼 提交于 2019-12-25 04:22:40

问题


I implemented Devise and went through the instructions to install 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 get a 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 the current_user line.

Can anyone tell me whats going on?


回答1:


You are creating a method called current_user, and you are returning the value of current_user.

Ruby doesn't require that you use parenthesis when calling methods.

current_user

is the same thing as

current_user()

You are calling the current_user function over and over and over again.

There is no reason for you to define a method called current_user, when devise gives that to you.



来源:https://stackoverflow.com/questions/22019767/rapidfire-and-devise

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!