Do you know what is “yield” in ruby on rails?



Do you know what is “yield” in ruby on rails?..

Answer / Nilesh Rai

"In Ruby, and therefore in Rails, yield is a keyword that allows you to pass control to a block of code. When called within a method definition, yield causes the method to execute any block of code provided as an argument, passing it any arguments specified after the yield statement. It's commonly used with iterators like each, map, and reduce."n

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Ruby on Rails Interview Questions

What is bundler?

1 Answers  


what are some advantages of using ruby on rails?

1 Answers  


iam new to the ruby on rails. suggest me some pdf and online books for ruby and rails

1 Answers  


Explain the various ide's of ruby on rails.

1 Answers  


what is Cross-Site Request Forgery (CSRF) and how Rails is protected against it?

1 Answers  


Why ruby on rails is used for?

1 Answers  


Can you list out what can rails migration do?

1 Answers  


Explain the advantages of ruby on rails?

1 Answers  


How would you create a controller for the subject?

1 Answers  


How to serialize data with yaml?

1 Answers  


How does router work in rails?

1 Answers  


Write the command to update rvm in rails.

1 Answers  


Categories