It seemed to work for me after I removed the quotes from the form being
observed.
I changed from
Form.serialize(‘form_name’)
to
Form.serialize(form_name)
and it worked again as before…
The relevant (new for 1.1) section of the API says:
:with: A JavaScript expression specifying the parameters for the
XMLHttpRequest. This defaults to â??valueâ??, which in the evaluated context
refers to the new field value. If you specify a string without a “=”,
itâ??ll be extended to mean the form key that the value should be assigned
to. So :with => “term” gives “â??termâ??=value”. If a “=” is present, no
extension will happen.
The problem is in the adding of the equals sign, etc. It’s trying to do
too much work for me.
Asa
daniel wiesmann wrote:
Asa H. wrote:
wants to do something like
Asa
Asa,
It seemed to work for me after I removed the quotes from the form being
observed.
I changed from
Form.serialize(‘form_name’)
to
Form.serialize(form_name)
and it worked again as before…
Including the = sign in the :with tag prevents it from rewriting with
‘=value’ at the end. However, the “foo =” part doesn’t matter at all,
except that it’s a valid statement. I see nothing about anything called
“foo” on the Rails side. I do, however, get the whole form into
params[] as I would like. So, it works, but feels shaky.
Asa
Asa H. wrote:
That doesn’t work for me. What happens is that the parameters passed
look like
The relevant (new for 1.1) section of the API says:
:with: A JavaScript expression specifying the parameters for the
XMLHttpRequest. This defaults to â??valueâ??, which in the evaluated context
refers to the new field value. If you specify a string without a “=”,
itâ??ll be extended to mean the form key that the value should be assigned
to. So :with => “term” gives “â??termâ??=value”. If a “=” is present, no
extension will happen.
The problem is in the adding of the equals sign, etc. It’s trying to do
too much work for me.
Asa
daniel wiesmann wrote:
Asa H. wrote:
wants to do something like
Asa
Asa,
It seemed to work for me after I removed the quotes from the form being
observed.
I changed from
Form.serialize(‘form_name’)
to
Form.serialize(form_name)
and it worked again as before…
hi there.
i had the same problem in an app where one dev used observe_fields
(little code snippet from the rails wiki)
the workaround didn´t work for me so i went ahead and just changed the
source of the prototype_helper and took out the part where it adds the =
value stuff.
its in
gems/actionpack-1.12.0/lib/action_view/helpers/prototype_helper.rb
in the function build_observer
just thought i´d mention that as another quick fix.
kind regards,
a
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.