Rails : render and exit immediately

前端 未结 2 678
误落风尘
误落风尘 2021-02-03 19:16

Using the omniauth gem, I am forced to define a single route callback for succesful logins, regardless of the provider :

def auth_callback 

        auth_data =          


        
2条回答
  •  既然无缘
    2021-02-03 19:59

    If you want to return from the chain of methods, e.g.

    def a
      ...
      b
      ...
      render "smth"
    end
    ...
    def b
      ...
      # render from some conditional from here
      ...
    end
    

    will cause AbstractController::DoubleRenderError, which means that you call render twice.

    You can read this article to find out 4 ways to manage such situation.

提交回复
热议问题