(Rails) What is “RJS”?
This Railscast gives a nice example of using RJS to add and remove form fields dynamically without hitting the server with an ajax call. These RJS tips may also be helpful.
This Railscast gives a nice example of using RJS to add and remove form fields dynamically without hitting the server with an ajax call. These RJS tips may also be helpful.
I would use content_for. For instance, specify the place to insert it in the application layout: <head> <title>Merry Christmas!</title> <%= yield(:head) -%> </head> And send it there from a view: <%- content_for(:head) do -%> <%= javascript_include_tag :defaults -%> <%- end -%>