Posts by brunoao86 • 36 points
2 posts
-
2
votes1
answer49
viewsA: How do I use the "define_method" correctly in Ruby?
The method define_method that you used to create the method :falar is a class method. The class method animal.falar that you call is an instance method (the object animal is an instance of the class…
-
0
votes1
answer116
viewsA: PATCH and PUT Rails
The call ApiModel.find(params[:id]) will fire an exception if the record does not exist in the bank (I am assuming you are using ActiveRecord). You can use the ApiModel.find_by(id: params[:id]) to…