|= " in this method? How it works?

问题描述 投票:0回答:1
First segment

also, i dont know what does (function()) mean in Ruby on rails. Its not simple function(), why is it inside brackets?

Second example

 def current_user
            @current_user ||= User.find(session[:user_id]) if session[:user_id]
          end

(function() {
  this.App || (this.App = {});

  App.cable = ActionCable.createConsumer();

}).call(this);
I have this example And i wanna understand what it is "
javascript ruby-on-rails-3
1个回答
© www.soinside.com 2019 - 2024. All rights reserved.