I am new to Ruby on Rails and am trying to gain a strong understanding of how MVC works.
I did the following:
rails new bubblesman
rails generate controller bubble
'welcome' => 'bubble#available'
ActionController::UnknownFormat (BubbleController#available is missing a template for this request format and 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.):
you need to create the
available.html.erb file within the
views/bubble/ directory. When the route takes you to that action, it also navigates you to that view, so if you put:
as the only line in that file, it should return that to you on the webpage.
In the future, you could use
rails g scaffold bubbles and that will create a majority of the files (MVC) and routes for you.