rails-ujs icon indicating copy to clipboard operation
rails-ujs copied to clipboard

Silent errors when missing .js template, but .html exists

Open printercu opened this issue 8 years ago • 0 comments

Hi!

There is */* in Accept header when remote requests are performed, so render in rails will render even html or any other templates. There is also known issue with suppressing error while executing script from response. So they both produces errors which are silent in production and can be detected in tests only either with complex browser tests, or with explicit format checks (I mean there is no exception at all when running post(path, params: params, xhr: true), in browser console too).

Do you think this behaviour should be fixed? I've found config.action_dispatch.ignore_accept_header, but it seems to appear only in 5.1.0 guides, and I don't think this is good solution for this case, as it works only for the whole app.

printercu avatar Mar 02 '17 08:03 printercu