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
Hello, I'm stuck between a rock and a hard place with this gem.
I used the exact same code as in the tutorial, but I can't get it to work.
At first, I tried this:
<%= form_for(@resource, remote: true, multipart: true) do |f| %>
<%= f.file_field :file %>
<%= f.submit %>
<% end %>
Here's the matching controller:
def create
respond_to do |format|
format.js
end
end
And the matching js file:
alert('success!');
<% if remotipart_submitted? %>
alert('submitted via remotipart')
<% else %>
alert('submitted via native jquery-ujs')
<% end %>
When I submit the form, nothing happens, and I get the following error in my logs:
Completed 406 Not Acceptable in 11ms
ActionController::UnknownFormat - ActionController::UnknownFormat:
Now the finny part is, if I specify the format, by using format: :js, the error disappears, but the form doesn't send anything. In fact, here are the request params:
Hello, I'm stuck between a rock and a hard place with this gem.
I used the exact same code as in the tutorial, but I can't get it to work.
At first, I tried this:
Here's the matching controller:
And the matching js file:
When I submit the form, nothing happens, and I get the following error in my logs:
Now the finny part is, if I specify the format, by using
format: :js
, the error disappears, but the form doesn't send anything. In fact, here are the request params:And the js file sends the
'submitted via native jquery-ujs'
message.Did I miss something ? I double checked all js inclusions, I got them all :
Thanks a lot
The text was updated successfully, but these errors were encountered: