On Martes, 28 de agosto de 2012 05:53:43 Mike Blyth escribió:
> I have a Javascript used on a new/edit form. It works fine when the formed
> is opened inline with edit, but it is not called with the *new* action
> (Create New). I'm not even sure why it works on edit, since it is activated
> with the document ready event. Anyway, I think what I need is an event
> triggered when that form is opened inline. Is there such an event? Any
> other method I can use to modify the form when it has been inserted? Thanks.
https://github.com/activescaffold/active_scaffold/wiki/Customizing-Forms-with-Javascript
To summarize:
$(document).on('as:action_success', '.your_controller-view
a.new, .your_controller-view a.edit', function(e, action_link) {
custom code (action_link.adapter is the create/update view)
});