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

Ruby

Unable to access localhost:3000/posts page

I am doing following steps 1: bin/rails new blog 2: cd blog 3: bin/rails generate scaffold posts title:string 4: bin/rails db:migrate 5: bin/rails server 6: launch browser and navigate to http://localhost:3000 7: Launch home page successfully 8: navigate to http://localhost:3000/posts Getting following error message:

/blog/app/views/layouts/application.html.erb where line #7 raised:

TypeError: Object doesn't support this property or method

<%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %>

Can you show the code in your application.html.erb file? It will help to better understand the error.

1 Answer

application.html.erb

<!DOCTYPE html> <html> <head> <title>Blog</title> <%= csrf_meta_tags %>

<%= stylesheet_link_tag    'application', media: 'all', 'data-turbolinks-track': 'reload' %>
<%= javascript_include_tag 'application', 'data-turbolinks-track': 'reload' %>

</head>

<body> <%= yield %> </body> </html>