Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

232
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!