[RUBY] How to deal with No template for interactive request

No template for interactive request occurred while creating the app.

error

In the case of I No template for interactive request PagesController#index is missing a template for request formats: text/html

Met.

routes.rb


Rails.application.routes.draw do
  resources :pages
  root 'pages#index'
end

pagescontroller


class PagesController < ApplicationController

  def index
  end
end

The view file was also created in app / view / pages with index.html.haml, so I couldn't solve it because I didn't understand the cause.

Cause

PagesController # index is missing a template for request formats: text / html and the error statement called the html statement, but I had generated a haml file.

Solution

Renamed file from index.html.haml to index.html.erb

I was able to solve it with this

To call a view file in haml

The poster wanted to use haml, but it seems that he had to install a gem called haml-rails to use haml.

gemfile


gem 'haml-rails'

You can now call the haml file.

Reflection

It was painful that this solution alone took about an hour, so I try to do trial and error at faster intervals.

Recommended Posts

How to deal with No template for interactive request
How to deal with Precompiling assets failed.
[Java] How to test for null with JUnit
How to use nginx-ingress-controller with Docker for Mac
How to implement login request processing (Rails / for beginners)
Diet program with preprocessor (how to deal with i-appli size)
How to deal with fatal: remote origin already exists.
[Docker environment] How to deal with ActiveSupport :: MessageEncryptor :: InvalidMessage
[Rails] How to deal with URL changes after render
How to make Laravel faster with Docker for Mac
Common problems with WSL and how to deal with them
[Docker + Rails] How to deal with Rails server startup failure
`bind': Address already in use --bind (2) for 127.0.0.1:3000 (Errno :: EADDRINUSE) How to deal with the error
How to number (number) with html.erb
How to update with activerecord-import
How to request a CSV file as JSON with jMeter
I got an error! * There is no interactive request template
How to test a private method with RSpec for yourself
How to deal with the error ERROR: While executing gem ... (Gem :: FilePermissionError)
How to deal with Bundler :: Dsl :: DSLError by rewriting gemfile
Investigated how to call services with Watson SDK for Java
How to deal with different versions of rbenv and Ruby
How to scroll horizontally with ScrollView
[Rails / RSpec] How to deal with element has zero size error
How to get started with slim
How to deal with 405 Method Not Allowed error in Tomcat + JSP
How to install JMeter for Mac
How to make a jar file with no dependencies in Maven
How to enclose any character with "~"
[Tips] How to solve problems with XCode and Swift for beginners
Android: How to deal with "Could not determine java version from '10 .0.1'"
How to use mssql-tools with alpine
Project facet Java version 13 is not supported. How to deal with
How to get along with Rails
[Beginner] How to delete NO FILE
How to deal with the type that I thought about writing a Java program for 2 years
How to execute Ruby irb (interactive ruby)
How to start Camunda with Docker
How to realize huge file upload with Rest Template of Spring
[For those who create portfolios] How to use binding.pry with Docker
How to read Body of Request multiple times with Spring Boot + Spring Security
[Java] How to turn a two-dimensional array with an extended for statement
How to bind request parameters in list format with bean property in Spring
Java8 / 9 Beginners: Stream API addiction points and how to deal with them
How to crop an image with libGDX
How to adjustTextPosition with iOS Keyboard Extension
How to share files with Docker Toolbox
How to use binding.pry for view files
How to compile Java with VsCode & Ant
How to install Play Framework 2.6 for Mac
[Java] How to compare with equals method
How to use BootStrap with Play Framework
[Rails] How to use rails console with docker
How to switch thumbnail images with JavaScript
How to delete the migration file NO FILE
[Note] How to get started with Rspec
How to create a Maven repository for 2020
How to do API-based control with cancancan
How to achieve file download with Feign
How to update related models with accepts_nested_attributes_for
[Ruby] How to use slice for beginners