Hello guys, in this article i am going to explain how to use yield within a class , we have seen many example like as —

but i have not seen how to use yield within a class, many guys encountered this, that’s why i tried for it , any suggestions or criticism are welcomed,

this is what i have tried

In this article, we’ll look at what bang methods are and how they work.

This article is divided into the following sections:

  1. What are bang methods in ruby
  2. Bang method must return a modified object
  3. Bang methods can return nil
  4. Usually, bang method has its non-bang equivalent
  5. Summary

What are bang methods in ruby

Methods that…

For everyone pulling their hair out trying to center things.

If you’re trying to center all your elements to the middle of your page, say like how this blog has borders equal to the left and right of itself, the following might be safe haven.

HTML

CSS

Most browsers auto text-align: center, so you can omit it, but if you want to be universal as possible, you have to be explicit. Text-align: left, if you don’t want things centered.

Occasionally in your travels, you’ll come across a little class-level declaration that sets a class as abstract:

This magic line has been the solution to some wandering Rubyists’ inheritence problems, and the source of many more. How…

How can we search through lists like objects and arrays?

As a beginner in Ruby, I struggled differentiating methods like .select and .find. They can be confusing and hectic concept if you do not have the knowledge of when to use them. I hope this post can help you understand the differences between the two.

The .find method

This Ruby method iterates through…

HI, This is Abhishek Tanwar (ROR DEVELOPER TRAINEE), I AM HERE TO EXPLAIN HOW TO WORK ON CUSTOM JS IN ACTIVE ADMIN , THIS METHOD IS HELP US MOSTLY GUYS WHOSE JUST DIVE INTO RAILS, LET’S SEE-

  1. JUST REQUIRE JS FILE ON active_admin.js ,which located inside following directory

app/assets/javascripts/active_admin.js

example…

When we examine their relationship, we notice that a doctor can see many patients and a patient also can be seen by many doctors. In this relationship, unlike the belongs to relationship, it is difficult to put a reference of one object in to the other, as one doesn’t solely…

Abhishek Tanwar

Ruby Developer

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store