0

I am developing a simple ruby on rails app.The server has started successfully.Then when we go to the default web url localhost:3000/ the default route is called showing the home page about the instructions.But we dont want this so need to remove the index.html.erb file in the public folder under the main project directory.The real problem is the file is missing and still the default page is loading.


What is really happening here and where is the index.html.erb file located.[Dont Mark it Duplicate because here the problem is different].How to call another route to show some mypage.html


Server Log

Started GET "/" for ::1 at 2016-04-19 23:29:26 +0530
Processing by Rails::WelcomeController#index as HTML
  Rendered C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/railties-4.2.5.1/lib/rails/templates/rails/welcome/index.html.erb (0.0ms)
Completed 200 OK in 36ms (Views: 35.1ms | ActiveRecord: 0.0ms)

Files in public folder:

400.html
422.html
500.html
favicon.ico
robots.txt
SaiKiran
  • 6,244
  • 11
  • 43
  • 76

3 Answers3

0

Add root to your routes.rb

root 'MyController#my_action'
Uzbekjon
  • 11,655
  • 3
  • 37
  • 54
0

You want to set your home root for your application. Just pick another route, example below.

root 'static_pages#home'
Tall Paul
  • 2,398
  • 3
  • 28
  • 34
  • 'Showing C:/Sites/myrubyblog/app/views/layouts/application.html.erb where line #5 raised: TypeError: Object doesn't support this property or method Rails.root: C:/Sites/myrubyblog Application Trace | Framework Trace | Full Trace app/views/layouts/application.html.erb:5:in `_app_views_layouts_application_html_erb__578736037_44980488'' – SaiKiran Apr 19 '16 at 18:13
  • You don't wan to link application as your home route. The issue with that is it a template and not an actual page, it just helps with rendering the pages. Go to `localhost:3000/rails/info` to see all of your routes that you coulde use – Tall Paul Apr 19 '16 at 18:17
0

Found this soluton Link here Coffee script 1.9.0 doesn't play well with Windows. On my Windows 7 machine, using version 1.8.0 solved this problem.

Add to Gemfile

gem 'coffee-script-source', '1.8.0'

then, run

bundle update coffee-script-source

and restart the server (if needed)

Community
  • 1
  • 1
SaiKiran
  • 6,244
  • 11
  • 43
  • 76