Tag Archive: ruby on rails

Jun
04

Ruby on Rails: remote functions do not work

Your remote_function or remote_form_tag could stop working if you use jQuery into your Ruby on Rails project. This is because the jQuery $ function is different from the prototype one, and RoR uses some particular function that is not available with jQuery. For example, you can get an error like this submitting your remote_form_tag: $(form).getElementsByTagName …

Continue reading »

Apr
30

Ruby on Rails: adding custom elements in generated xml

If you create a scaffold for your rails project, it will create for you a lot of things; for example, a way to show your object in xml format. But what about adding custom elements to that xml? I solved in this way: class MyObject < ActiveRecord::Base #[...] def to_xml(options={}) cp = attributes.clone cp["something"] = …

Continue reading »