nateberkopec / todomvc-turbolinks

TodoMVC with Turbolinks 3
http://todomvc-turbolinks.herokuapp.com
Other
137 stars 33 forks source link

Question about the filtering links #2

Closed abitdodgy closed 9 years ago

abitdodgy commented 9 years ago

Why not use view helpers on line 47 of index.html.erb? For example:

= link_to "Completed", params.merge(complete: false), class: ('selected' if params[:completed] == 'false')

Instead of...

<a id="active" href="/?completed=false" class="<%= "selected" if request.fullpath.match("completed=false") %>">Active</a>

Is it a matter of preference or are you trying to gain some performance?

nateberkopec commented 9 years ago

Definitely just silly coding. I don't believe there is any performance advantage to be gained in not using link helpers - and if there was, you should just cache the results instead of not using the helper.