I need to upload several files using nested form and jQuery, so I wrote a helper using the link_to_function method Is:
def add_document_link (title, form) link_to_function title page | Form.fields_for: document, document.new ,: child_index = & gt; Time.now.to_i do F | Page & lt; & Lt; "$ {'# Document'}. ('# {Escap_javascript (render (' / relatts / document ',: f => f))}' '; end ending
< P> This code only creates a link that, if pressed, a new file upload provides nested form, it works surprisingly , even if I use Rail 3 beta 4 (And I know that 'link_to_function' dislikes) There is a better way of doing this without using link_to_function AJAX call?
Thanks in advance;)
You can take my Look at the project that has been taken from the work of some others. The same way work for Rail 3 (I have upgraded the project locally for only one test) The big issue is deep nested element, but this project Should display a UAS method of working with jquery and railway generated templates.
Comments
Post a Comment