You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
def create()
if params[:note][:id].present?
@note = Note.find(params[:note][:id])
@note.update_attributes(params[:note])
else
@note = Note.new(params[:note])
@note.save
end
if request.xhr?
if @note.note_object_type == ProductInstance.class.to_s
render js: "window.location.replace('#{notes_url(:product_instance_id => @note.product_instance_id.to_s)}');"
else
render js: "history.back();"
end
else
if @note.note_object_type == ProductInstance.class.to_s
redirect_to notes_path(:product_instance_id => @note.product_instance_id.to_s)
else
redirect_to :back
end
end
end
The autosave is not firing after firs attempt.....here is my code
At
And at
def create() if params[:note][:id].present? @note = Note.find(params[:note][:id]) @note.update_attributes(params[:note]) else @note = Note.new(params[:note]) @note.save end if request.xhr? if @note.note_object_type == ProductInstance.class.to_s render js: "window.location.replace('#{notes_url(:product_instance_id => @note.product_instance_id.to_s)}');" else render js: "history.back();" end else if @note.note_object_type == ProductInstance.class.to_s redirect_to notes_path(:product_instance_id => @note.product_instance_id.to_s) else redirect_to :back end end end
and in the view
<%= my_form.text_area :note, class: "redactor form-control", rows: 100, columns: 100 %>
Am i missing something or wrongly coded??
The text was updated successfully, but these errors were encountered: