Posts [ 5 ]

Topic: Form has suddenly stopped working

This really has me stumped.. I have a view with a form full of text fields, text areas, etc to create a new record which has been working just fine for days. Now, suddenly and without anything being changed, it's not happy with my text_field tags!!

This is the first text_field on the page and therefore is the first to throw errors:

Even without the :class => "fill" bit, it throws this error; wrong number of arguments (1 for 0).. !?

I'm so confused as to why it's suddenly decided to pack in. I've checked everything I can think of.. db connection's fine, the view is getting rendered with a @newsletter active record object, the log doesn't tell me anything.. everything looks like it should work and text_fields on other pages still work, just not this one.

Please help!! I'm ripping my hair out here! I just can't see why it would work fine one day and not the next.

Re: Form has suddenly stopped working

Well, I think i've found the culprit... I had a method i'd created in the model in question which was called send. I guess it wasn't happy with that. I've renamed it to send_newsletter and it works now. I guess 'send' is a reserved word?

Re: Form has suddenly stopped working

Re: Form has suddenly stopped working

The primary reason being that every base class/method in Ruby can't be an model/attribute name because it will override the existing one in Ruby. I wish there was a convenient way to use namespacing to avoid this problem completely, but I'm sure it would have been done by now if it was easy.