This is a bug I am only experiencing only in chrome and is only happening on a specific route - /dashboard/friends. The html is appearing as plain text, that is wrapped inside a
<pre style="word-wrap: break-word; white-space: pre-wrap;">
If I make any change to the contents of the files associated with the view like simply putting "blah" in the index.haml file it will then render properly. Anyone have any idea about what might be causing this?
EDIT: this is what renders in the browser -
<html>
<head>
</head>
<body>
<pre style="word-wrap: break-word; white-space: pre-wrap;">
"my apps view renders in here including the head and html,
but since it is in quotes, it just appears as plain text
<!DOCTYPE>
<html>
entire rails app html here...
</html>"
</pre></body></html>
the bug seems to be related to the @invites variable I have in the controller, removing it fixes the issue -
class Dashboard::FriendsController < Dashboard::BaseController
def index
@friends = current_user.friends
#removing the @invites var fixes it, but I need those invitations...
@invites = current_user.invitations.where(type: "FriendInvite").includes(:recipient)
end
end
In the index.haml
%header.page-hdr
%h1
Friends
%ul
%li
= link_to dashboard_find_friend_path, class: "btn" do
.fa.fa-plus
Add a Friend
.row
- if @friends.empty?
You have no friends
- else
- @friends.each do |friend|
= render 'friend', friend: friend
- if @invites.present?
%h2
Invited
- @invites.each do |inv|
= render partial: 'invite', locals: {inv: inv}
This is the layout.haml -
!!! 5
%html
%head
%title= full_title(yield(:title))
= stylesheet_link_tag "application", media: "all", "data-turbolinks-track" => true
= javascript_include_tag "application", "data-turbolinks-track" => true
= csrf_meta_tags
= favicon_link_tag '/favicon.ico'
= favicon_link_tag '/favicon.png', rel: 'apple-touch-icon', type: 'image/png'
%script{ type: "text/javascript", src: "//use.typekit.net/gey0efl.js" }
%script{ type: "text/javascript"}
try{Typekit.load();}catch(e){}
%body#dashboard-body
= render current_user.navigation
#dashboard-wrapper
= render "shared/dashboard/header"
= yield
UPDATE: upgraded to Rails 4.1, no luck. Again only breaking in chrome, and only when I include that second instance variable AND, that variable has been modified in some way( new record added)