app/helpers/application_helper.rb
# Currently signed in user (if any) details to be passed to the client-side
# JS code.
Currently signed in user (if any) details to be passed to the client-side
JS code.
Currently signed in user ( if any ) details to be passed to the client - side JS code .
def current_user_json
    if current_user
      { id: current_user.id,
        email: current_user.email,
        name: current_user.name,
        stipend: current_user.stipend,
        roles: current_user.roles.pluck(:name) }.to_json
    end
  end
def current_user_json if current_user { id : current_user . id , email : current_user . email , name : current_user . name , stipend : current_user . stipend , roles : current_user . roles . pluck ( :name ) } . to_json end end
Currently signed in user (if any) details to be passed to the client-side
JS code.
Currently signed in user ( if any ) details to be passed to the client - side JS code .