How do I pass a value to a dynamic method name that's called on a rails model?
@model.send(dynamic_method_name.to_sym,123)
This gives the error:
wrong number of arguments (1 for 0)
If I were to use the same method like this though:
@model.post_id = 123
then it works.
So there is a "setter" method for the method post_id (and therefore the dynamic method name).
How do I pass a value to this setter when the method is dynamic?
thanks!