I have controller and view (/app/controllers/greeting_controller.rb
and /app/views/greeting/index.rhtml /.erb/.html.erb - doesn't match).
You don't say which version of Rails you are using, so I will assume 2.x. If
1.x or 3.x, ignore this reply.
greeting_controller.rb and index.rhtml look fine. But they are not following
Rails naming conventions, controller names are plural, i.e.,
greetings_controller.rb and /app/views/greetings/. index.rhtml is old style
naming, preferred current practice is index.html.erb. These two changes may
be enough to solve your problem.
I don't understand the last bit of the sentence above. Please expand what you
mean by "/.erb/.html.erb - doesn't match". Do you mean that
/app/view/greeting/index.erb and /app/view/greeting/index.html.erb are ignored
by the template engine?
I don’t understand the last bit of the sentence above. Please expand what you
mean by “/.erb/.html.erb - doesn’t match”. Do you mean that
/app/view/greeting/index.erb and /app/view/greeting/index.html.erb are ignored
by the template engine?
Yes!
It doesn’t make sense.
I’m using 2.x version.
Now controller name is Greetings, and view file name is index.html.erb
I don't understand the last bit of the sentence above. Please expand what
you
mean by "/.erb/.html.erb - doesn't match". Do you mean that
/app/view/greeting/index.erb and /app/view/greeting/index.html.erb are
ignored
by the template engine?
Yes!
It doesn't make sense.
I'm using 2.x version.
Now controller name is Greetings, and view file name is index.html.erb
But the problem hasn't been solved
Please tell us the current filenames and contents again to make sure
of what you have done. Have you removed all the old files? Rails has
a habit of loading files that you have left lying around by accident.
What exactly is the symptom now seen?