I created the whole responsive site in notepad - shop.html. I can see its directory in rails. Put all my files in public folder of its rails app. Now I dont know how to load it in localhost:3000. How do i do that. Have configured everything. Rails server is running and It shows only the default index.html file. But when i write rails generate controller eshop. It says uninitialized constant welcome error. PS: i m new to ruby. All guides show how to create a new app but I couldnt find a way to load a html page already created in editor to load in browser using rails server. Thanks in advance.
-
I m using Linux mint, rails 4 and everything is updated with all gemsAditya Shukla– Aditya Shukla2015-08-16 10:54:30 +00:00Commented Aug 16, 2015 at 10:54
-
yep, just did. it says : "no route matches [GET] "/shop.html". It is giving me a Routes helper where It is asking me to provide a path/url. I tried copying the path from the directory but it say Path Matching (/eshop/public): No matches found.Aditya Shukla– Aditya Shukla2015-08-16 11:01:30 +00:00Commented Aug 16, 2015 at 11:01
-
You didn't even read any rails tutorial, did you?mtszkw– mtszkw2015-08-16 11:09:32 +00:00Commented Aug 16, 2015 at 11:09
-
Read about ruby on rails views first, bro.mtszkw– mtszkw2015-08-16 11:10:00 +00:00Commented Aug 16, 2015 at 11:10
Add a comment
|
1 Answer
Since you generated a controller you need to put the content from your shop.html file into the /views/eshop/index.html.erb file
Open the routes file under config/routes.rb and change the following line
from:
root "welcome#index"
to:
root "eshop#index"
this way your app will point to the right file.
Subsequently you could just point the root to the shop.html file which I do not recommend. However you should definitely look into routing in rails and how it works.
2 Comments
Mr. Z.
If it worked make sure to mark the answer as correct
Nube Colectiva
Works for me on Ruby on Rails 7.1.3.4