Category : Ruby On Rails
Category : Ruby On Rails
I have manage to fix my ExecJS::ProgramError as mentioned in my last post.
The error got disappeared as soon as I change the “application” to “default”. But the issue I faced now is, my app is unable to locate and load the CSS and JS. None of the styles got loaded.
I tried to inspect the issue. Looked into the source rendered in the browser by choosing the “view source” option.
From the source it looks like the app is trying to locate the default.css and default.js, which is not present.
Categories: Ruby On Rails
Created a new project in rails
$ rails new StaticPageDemo
Added static_page controller to it with home action
$ rails generate controller static_page home
Ran the server
$ rails server
Got this error while tried to access the page in http://localhost:3000/static_page/home
After some search in Google, I got a solution from this link, which helped me fixing the issue. I also learned, It is an issue with the windows. The application parameter works on the web server.
Opened the application.html.erb in app/views/layouts folder of StaticPageDemo project. Replaced application with default.
1 2 3 4 |
<%= stylesheet_link_tag 'default', media: 'all', 'data-turbolinks-track' => true %> <%= javascript_include_tag 'default', 'data-turbolinks-track' => true %> |
Categories: Ruby On Rails