Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial
ali yeysides
1,885 PointsWhat is the difference between index.html and index.html.erb?
What is the difference between index.html and index.html.erb? Since I wasn't going to use devise I needed to create a starting page to route to so I did what the ruby website said and ran rails generate home index as a home file. However that file is an .erb file and I'm not sure if it's the cause of all the problems I've been having recently.
5 Answers
Andrew Chalkley
Treehouse Guest TeacherThe /public/index.html is a public facing webpage that has no Ruby tempting. This overrides anything defined in your routes.rb. So you need to delete it. (In Rails 4 this is not an issue). /app/home/index.html.erb Is can have Embeded Ru_b_y so any instance variables assigned in your HomeController in the index action get passed to the template and can be used. Your site is now dynamic (but it doesn't have to be).
ali yeysides
1,885 PointsAndrew,
In firebug I continue to receive error logs saying there are 404's on my links to css files and images. Im positive the syntax is correct and so are the paths. Am I missing a gem or plugin or something??
Andrew Chalkley
Treehouse Guest TeacherWhat does your routes.rb file say?
ali yeysides
1,885 Pointsroot :to => "home#index"
Andrew Chalkley
Treehouse Guest TeacherSeems right :)
What URL are you typing in?