lundi 13 juin 2016

How to pass parameter in rails method?

I have the following method that returns true or false:

def my_method?
  # do stuff here
end

The question is, can I pass parameter with above method? How can I achieve this thanks!

I do like this but it won't work:

def my_method?(params)
  # do stuff
end

User.my_method?(params)

Aucun commentaire:

Enregistrer un commentaire