Rails is looking for the wrong method

I have a column named _SOMETHING as part of an object created with rails g scaffold, say: rails g scaffold Person _SOMETHING:string

In the create method, when you do @ person.save, a popup message appears that it cannot find the method something

(no underscore and lower case).

Why is he looking for a method with this name?

I secured it by creating

def something
   true
end

      

in my Person model. I'm pretty sure this is not the correct way to solve this problem. Using Ruby 2.2.2, Rails 4.2.1

Thank you in advance

+3


source to share


1 answer


It turns out the model had a validation where I mistyped the column name, failing every time. Name changed _SOMETHING

and it worked.



Thank you all for your attention to this stupid issue.

0


source







All Articles