Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

233
Visualizações
How to cause rerender of 2 components linked with database?

Suppose I have 2 components which are not linked (by props) A and B. They are linked but by the database, A has a button which allows it to change the database. And I want B to rerender (not all the page) when the database changes, is that possible?

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

&. is called a safe navigation operator which was introduced in ruby 2.3, it works similar to the try! method and returns nil if the object is nil else returns the attribute value of the object.

object = OpenStruct.new(a: 1)
object&.a
# => 1 

object = nil
object&.a
# => nil 

object.a
# Traceback (most recent call last):
#         1: from (irb):21
# NoMethodError (undefined method `a' for nil:NilClass)

You can see in the above example the difference when we are calling a on an object with and without &. operator.

Refer SO answer for more details on it.

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda