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 Build a Todo List Application with Rails 4 Build a Todo List Application with Rails 4 Generate a Scaffold

I always get an error for having this line <%= javascript_include_tag 'application', 'data-turbolinks-track' => true %

for my app to work I have to remove that line from the Application.html.rb file

4 Answers

Alexander Batalov
Alexander Batalov
21,887 Points

You forgot '>' at the end, so full tag looks like

<%= javascript_include_tag "application", "data-turbolinks-track" => true %>

It also might be an issue in JS file. Could you paste here your error output?

yeah that was just a typo, this is what I always get

Showing C:/RailsInstaller/DevKit/home/D4rk M4tt3r/UnitedVerse/UnitedVerseApp/app/views/layouts/application.html.erb where line #7 raised:

(in c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/turbolinks-2.2.2/lib/assets/javascripts/turbolinks.js.coffee) Extracted source (around line #7): 4 5 6 7 8 9 10

<title>UnitedVerseApp</title>
<%= stylesheet_link_tag    'application', media: 'all', 'data-turbolinks-track' => true %>
<%= csrf_meta_tags %>
<%= javascript_include_tag "application", "data-turbolinks-track" => true %>

</head> <body>

Rails.root: C:/RailsInstaller/DevKit/home/D4rk M4tt3r/UnitedVerse/UnitedVerseApp

Application Trace | Framework Trace | Full Trace app/views/layouts/application.html.erb:7:in `app_views_layouts_application_html_erb__908344169_36096576' Request

Parameters:

None Toggle session dump Toggle env dump Response

Headers:

None

Michelle Cannito
Michelle Cannito
8,992 Points

An ending tag will never have an equals sign. For this application, you probably don't want the = sign in front either.

Use <%= %> when the contents are a value you want to display.

Use <% %> for logic, such as if statements, a for each do statement, and end tags.

Kang-Kyu Lee
Kang-Kyu Lee
52,045 Points

If you don't need JS on your app, then how about deleting app/assets/javascripts folder? Curious what happens.

I need it, that's why I'm hoping to fix this problem, thi is what I get

Showing C:/RailsInstaller/DevKit/home/D4rk M4tt3r/UnitedVerse/UnitedVerseApp/app/views/layouts/application.html.erb where line #7 raised:

(in c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/turbolinks-2.2.2/lib/assets/javascripts/turbolinks.js.coffee) Extracted source (around line #7): 4 5 6 7 8 9 10

<title>UnitedVerseApp</title>
<%= stylesheet_link_tag    'application', media: 'all', 'data-turbolinks-track' => true %>
<%= csrf_meta_tags %>
<%= javascript_include_tag "application", "data-turbolinks-track" => true %>

</head> <body>

Rails.root: C:/RailsInstaller/DevKit/home/D4rk M4tt3r/UnitedVerse/UnitedVerseApp

Application Trace | Framework Trace | Full Trace app/views/layouts/application.html.erb:7:in `app_views_layouts_application_html_erb__908344169_36096576' Request

Parameters:

None Toggle session dump Toggle env dump Response

Headers:

None

Did you find an answer to this? I'm getting an error on the same line.

After trying a couple of fixes suggested online, I changed "application" to "default": This did not work. The page displayed, but the Destroy link (needing javascript) did not work.

Several people (or maybe the same one over and over) mentioned reverting coffee-script-source to version 1.8.0. Mine was 1.9.1.1. This seems to work - the page displays and the Destroy link opens a warning dialog before removing the item.