Verlassen einer Vorlage für dieses Anforderungsformat und diese Variante

Ich bin neu bei Ruby on Rails und versuche, mir ein genaues Bild von der Funktionsweise von MVC zu machen.

Ich habe folgendes getan:

rails new bubblesman 
rails generate controller bubble

in meinem Bubble Controller habe ich eine Methode wie folgt erstellt:

def available
  puts "YEP!!!!!!"
end

Ich füge Folgendes in meine Routendatei ein:

'welcome' => 'bubble#available'

Ich navigiere zuhttp: // localhost: 3000 / welcome Ich erhalte den folgenden Fehler:

ActionController::UnknownFormat (BubbleController#available is missing a template for this request format and variant.

request.formats: ["text/html"]
request.variant: []

NOTE! For XHR/Ajax or API requests, this action would normally respond with 204 No Content: an empty white screen. Since you're loading it in a web browser, we assume that you expected to actually render a template, not… nothing, so we're showing an error to be extra-clear. If you expect 204 No Content, carry on. That's what you'll get from an XHR or API request. Give it a shot.):

was ich auch nicht verstehe, ist, wenn ich dies in meinem Helfer-Controller anstelle meines Hauptcontrollers stecke, funktioniert alles gut.

Antworten auf die Frage(2)

Ihre Antwort auf die Frage