Jump to content

The ultimate community for Ruby on Rails developers.


Cant find my index.html.erb file after generating Controller

Controllers & views

  • Please log in to reply
2 replies to this topic

#1 ullustin



  • Members
  • 1 posts

Posted 07 March 2014 - 09:26 PM

Hi, I am new to rails developing and I am trying to get my first project running.

I generated a new controller in my new blog site and i cant find my index.html.erb

file in the view/pages directory.


What can i do to put it in there.


Thank You

#2 Simply Misunderstood

Simply Misunderstood


  • Members
  • 7 posts

Posted 10 March 2014 - 04:25 PM

You could easily create a blank file called index.html.erb in the view/pages directory.   Assuming that the controller you created was called page.

  • Jamie likes this

#3 himanshu339



  • Members
  • 9 posts

Posted 17 March 2014 - 08:15 AM

You can generate views in two ways:


  1. by giving method names while generating controller. For example: here transaction controller will be generated with methods index and show and also views will be generated `rails generate controller Product index show`
  2. since in your case the views have not been generated, you can create a balnk file and rename it to index.html.erb


Hope this helps!

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users