Skip to content

UsersController#edit - request.formats: ["text/html"] request.variant: []  #65

@thomami244

Description

@thomami244

Thanks for a great tutorial! I am a new/intermediate Ruby programmer, who has been trying to run your code with newer versions of Ruby/ Webpacker, due to installation problems with the given Ruby version.

I have run the code on Ruby v 3.0.0 and v 3.1.2, and I keep getting the same error message when I try to edit a cell in the table. It appears that the "edit.js.erb" file is no longer accepted, as it is expecting an html file instead.

I have done some research and it appears that perhaps adding the option xhr: true may solve this issue:
https://joshfrankel.me/blog/fix-missing-template-for-request-format-and-variant-while-testing-ajax-request-in-request-spec/

"ActionController::UnknownFormat in UsersController#edit
UsersController#edit is missing a template for this request format and variant. request.formats: ["text/html"] request.variant: []

Extracted source (around line #42):
40 41 42 43 44 45 "\nrequest.variant: #{request.variant.inspect}" raise ActionController::UnknownFormat, message elsif interactive_browser_request? message = "#{self.class.name}##{action_name} is missing a template for request formats: #{request.formats.map(&:to_s).join(',')}" raise ActionController::MissingExactTemplate, message
"

Gemfile lock:
GEM
remote: https://rubygems.org/
specs:
actioncable (6.0.6)
actionpack (= 6.0.6)
nio4r (> 2.0)
websocket-driver (>= 0.6.1)
actionmailbox (6.0.6)
actionpack (= 6.0.6)
activejob (= 6.0.6)
activerecord (= 6.0.6)
activestorage (= 6.0.6)
activesupport (= 6.0.6)
mail (>= 2.7.1)
actionmailer (6.0.6)
actionpack (= 6.0.6)
actionview (= 6.0.6)
activejob (= 6.0.6)
mail (
> 2.5, >= 2.5.4)
rails-dom-testing (> 2.0)
actionpack (6.0.6)
actionview (= 6.0.6)
activesupport (= 6.0.6)
rack (
> 2.0, >= 2.0.8)
rack-test (>= 0.6.3)
rails-dom-testing (> 2.0)
rails-html-sanitizer (
> 1.0, >= 1.2.0)
actiontext (6.0.6)
actionpack (= 6.0.6)
activerecord (= 6.0.6)
activestorage (= 6.0.6)
activesupport (= 6.0.6)
nokogiri (>= 1.8.5)
actionview (6.0.6)
activesupport (= 6.0.6)
builder (> 3.1)
erubi (
> 1.4)
rails-dom-testing (> 2.0)
rails-html-sanitizer (
> 1.1, >= 1.2.0)
activejob (6.0.6)
activesupport (= 6.0.6)
globalid (>= 0.3.6)
activemodel (6.0.6)
activesupport (= 6.0.6)
activerecord (6.0.6)
activemodel (= 6.0.6)
activesupport (= 6.0.6)
activestorage (6.0.6)
actionpack (= 6.0.6)
activejob (= 6.0.6)
activerecord (= 6.0.6)
marcel (> 1.0)
activesupport (6.0.6)
concurrent-ruby (
> 1.0, >= 1.0.2)
i18n (>= 0.7, < 2)
minitest (> 5.1)
tzinfo (
> 1.1)
zeitwerk (> 2.2, >= 2.2.2)
addressable (2.8.1)
public_suffix (>= 2.0.2, < 6.0)
bindex (0.8.1)
bootsnap (1.15.0)
msgpack (
> 1.2)
builder (3.2.4)
byebug (11.1.3)
capybara (3.38.0)
addressable
matrix
mini_mime (>= 0.1.3)
nokogiri (> 1.8)
rack (>= 1.6.0)
rack-test (>= 0.6.3)
regexp_parser (>= 1.5, < 3.0)
xpath (
> 3.2)
concurrent-ruby (1.1.10)
crass (1.0.6)
date (3.3.2)
erubi (1.11.0)
ffi (1.15.5)
globalid (1.0.0)
activesupport (>= 5.0)
i18n (1.12.0)
concurrent-ruby (> 1.0)
jbuilder (2.11.5)
actionview (>= 5.0.0)
activesupport (>= 5.0.0)
listen (3.0.8)
rb-fsevent (
> 0.9, >= 0.9.4)
rb-inotify (> 0.9, >= 0.9.7)
loofah (2.19.1)
crass (
> 1.0.2)
nokogiri (>= 1.5.9)
mail (2.8.0)
mini_mime (>= 0.1.1)
net-imap
net-pop
net-smtp
marcel (1.0.2)
matrix (0.4.2)
method_source (1.0.0)
mini_mime (1.1.2)
minitest (5.16.3)
msgpack (1.6.0)
net-imap (0.3.2)
date
net-protocol
net-pop (0.1.2)
net-protocol
net-protocol (0.2.1)
timeout
net-smtp (0.3.3)
net-protocol
nio4r (2.5.8)
nokogiri (1.13.10-arm64-darwin)
racc (> 1.4)
public_suffix (5.0.1)
puma (3.12.6)
racc (1.6.1)
rack (2.2.4)
rack-proxy (0.7.4)
rack
rack-test (2.0.2)
rack (>= 1.3)
rails (6.0.6)
actioncable (= 6.0.6)
actionmailbox (= 6.0.6)
actionmailer (= 6.0.6)
actionpack (= 6.0.6)
actiontext (= 6.0.6)
actionview (= 6.0.6)
activejob (= 6.0.6)
activemodel (= 6.0.6)
activerecord (= 6.0.6)
activestorage (= 6.0.6)
activesupport (= 6.0.6)
bundler (>= 1.3.0)
railties (= 6.0.6)
sprockets-rails (>= 2.0.0)
rails-dom-testing (2.0.3)
activesupport (>= 4.2.0)
nokogiri (>= 1.6)
rails-html-sanitizer (1.4.4)
loofah (
> 2.19, >= 2.19.1)
railties (6.0.6)
actionpack (= 6.0.6)
activesupport (= 6.0.6)
method_source
rake (>= 0.8.7)
thor (>= 0.20.3, < 2.0)
rake (13.0.6)
rb-fsevent (0.11.2)
rb-inotify (0.10.1)
ffi (> 1.0)
regexp_parser (2.6.1)
rexml (3.2.5)
rubyzip (2.3.2)
sass (3.7.4)
sass-listen (
> 4.0.0)
sass-listen (4.0.0)
rb-fsevent (> 0.9, >= 0.9.4)
rb-inotify (
> 0.9, >= 0.9.7)
sass-rails (5.1.0)
railties (>= 5.2.0)
sass (> 3.1)
sprockets (>= 2.8, < 4.0)
sprockets-rails (>= 2.0, < 4.0)
tilt (>= 1.1, < 3)
selenium-webdriver (4.7.1)
rexml (
> 3.2, >= 3.2.5)
rubyzip (>= 1.2.2, < 3.0)
websocket (> 1.0)
sprockets (3.7.2)
concurrent-ruby (
> 1.0)
rack (> 1, < 3)
sprockets-rails (3.4.2)
actionpack (>= 5.2)
activesupport (>= 5.2)
sprockets (>= 3.0.0)
sqlite3 (1.5.4-arm64-darwin)
thor (1.2.1)
thread_safe (0.3.6)
tilt (2.0.11)
timeout (0.3.1)
turbolinks (5.2.1)
turbolinks-source (> 5.2)
turbolinks-source (5.2.0)
tzinfo (1.2.10)
thread_safe (
> 0.1)
web-console (4.2.0)
actionview (>= 6.0.0)
activemodel (>= 6.0.0)
bindex (>= 0.4.0)
railties (>= 6.0.0)
webdrivers (5.2.0)
nokogiri (> 1.6)
rubyzip (>= 1.3.0)
selenium-webdriver (
> 4.0)
webpacker (4.3.0)
activesupport (>= 4.2)
rack-proxy (>= 0.6.1)
railties (>= 4.2)
websocket (1.2.9)
websocket-driver (0.7.5)
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.5)
xpath (3.2.0)
nokogiri (~> 1.8)
zeitwerk (2.6.6)

PLATFORMS
arm64-darwin-21

DEPENDENCIES
bootsnap (>= 1.4.2)
byebug
capybara (>= 2.15)
jbuilder (> 2.5)
listen (>= 3.0.5, < 3.2)
puma (
> 3.12)
rails (> 6.0.0.rc1)
sass-rails (
> 5)
selenium-webdriver
sqlite3 (> 1.4)
turbolinks (
> 5)
tzinfo-data
web-console (>= 3.3.0)
webdrivers
webpacker (~> 4.0)

RUBY VERSION
ruby 3.0.0p0

BUNDLED WITH
2.2.3

911 inline error message.pdf

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions