The controller:
class ProfilesController < ApplicationController
def show
end
end
When controller responds show action as JS, show.js.erb
contains the following:
$('#main-content').html('<%= j( render( template: "profiles/show.html.erb" ) ) %>');
The problem is that I18n.t's scope get messed up when it attempts to fetch keys:
ActionView::Template::Error (translation missing: en.profiles.show.html.erb.followers)
.
If I don't specify .html.erb
part, it attempts to render show.js.erb
which happens a infinite loop, so I must supply the html format.
What can I do?