I am encountering an issue with my form and AJAX. The form resides in the FirstsController
, but I need it to be sent to the SecondsController
. After successfully sending the form and saving the data, I attempt to replace the form with text using the following method:
def create
...saving...
respond_to do |format|
format.js {
render :update do |page|; page << "$('#id_element').html('hellllloooooo');" end
}
format.html {}
end
end
Unfortunately, when I implement this code, I receive the following error:
ActionView::MissingTemplate (Missing template seconds/update, application/update with {:handlers=>[:erb, :builder, :coffee], :formats=>[:js, :html], :locale=>[:en, :en]}.):
How do I redirect the JavaScript request back to the FirstsController
? Additionally, do I need any assistance with a *.js file?