That needs to be <%=
observe_field just returns the appropriate javascript statement so if
you use <% then that javascript is never inserted into the view.
while the statement show_custom_repeat is legal javascript, it is a
statement with no effect, it just evaluates to the function object (in
the same way that in ruby the expression “Object” is perfectly legal
but doesn’t do an awful lot). If you want to call your function you
need show_custom_repeat() instead of show_custom_repeat
Fred
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.