Displaying 1 result from an estimated 1 matches for "worldscontrol".
Did you mean:
worldcontrol
2013 Oct 18
3
before_action - performing an action to prevent
class WebsocketController < WebsocketRails::BaseController
private
def authenticate?
unless current_user.token == message[:token]
current_redirect_to ''home/index''
false # that here we need to do to stop the further execution?
end
end
end
class WorldsController < WebsocketController
before_action :authenticate?
def index
current_html_insert ''worlds/index''
end
end
From the documentation: If you call *render*, *head* or *redirect_to* from
a *before_action*, the filter chain will be halted, but I have a different
situat...