Cannot add blank pages with simple text to rails server

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Cannot add blank pages with simple text to rails server

Teguh Perdana Putra
Dear ruby on rails group,

Good day!

I am now learning ruby on rails as a newbie to be able to make a simple website from scratch.

I am enrolled for onemonth course on Rails on Ruby for Web Development. One of their exercise is to change the default Rails page that can be seen from "localhost:3000" into a blank page with two sentences (basic strings).

I am running this with Git Bash on Windows. When inputting command "rails generate controller pages home" and open "localhost:3000/pages/home" in my browser, this is what I got instead of a blank page with two sentences.

And this is what I got in the Git Bash;

_______________________________________________________________________________________

Started GET "/pages/home" for 127.0.0.1 at 2017-11-21 13:42:40 +0800
Processing by PagesController#home as HTML
Rendering pages/home.html.erb within layouts/application
Rendered pages/home.html.erb within layouts/application (2.0ms)
Completed 500 Internal Server Error in 6707ms

ActionView::Template::Error (TypeError: Object doesn't support this property or
method):
4: <title>Omrails</title>
5: <%= csrf_meta_tags %>
6:
7: <%= stylesheet_link_tag 'application', media: 'all', 'data-turboli
nks-track': 'reload' %>
8: <%= javascript_include_tag 'application', 'data-turbolinks-track': 'r
eload' %>
9: </head>
10:

app/views/layouts/application.html.erb:7:in `_app_views_layouts_application_html
_erb__466066971_29636976'
Started GET "/pages/home" for 127.0.0.1 at 2017-11-21 13:45:08 +0800
Processing by PagesController#home as HTML
Rendering pages/home.html.erb within layouts/application
Rendered pages/home.html.erb within layouts/application (1.0ms)
Completed 500 Internal Server Error in 1696ms

-------------------------------------------------------------------------


Please kindly help me to understand, as I am a complete newbie who wants to have a very basic back-end programming. Without understanding this I am afraid my learning has come to a pause.


Thanks very much for your kindness, and I hope you all have a great day!


Cordially,

Teguh Perdana Putra

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/dfca4920-3b99-4443-96f0-e4b88ecccc68%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Cannot add blank pages with simple text to rails server

Olexandr Averyanov
Hi there
I would recommend you to change your operation system to Ubuntu or some other Linux distributive, otherwise you will get strange errors very often.

About current problem - try to change parameter 'application' to 'default' in your app/views/layouts/application.html.erb line 7 and 8

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/19e0aa95-9852-4329-9659-d7a537298e1a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.