Ask A Question


You’re not receiving notifications from this thread.

My html.erb view is not being loaded with style, after ajax submission.

Doctuh asked in Rails


I have created a partial that gets rendered on my index page, via AJAX. This works flawless. However when I access the route, that i also want the rendered partial to show up on, it renders with no styling, as plain HTML. I have made a video that shows it pretty well. Pay notice when I access my route /accounts/euw. This is where it renders it as plain HTML, which I dont wan't, I want it to be rendered like the AJAX, with all style in-tact. What am I doing wrong??

My controller:
def euw
@euw_products = Server.find(1).products
respond_to do |format|
format.js { render partial: 'accounts/euw_result' }
format.html { render partial: 'accounts/euw'}

Join the discussion

Want to stay up-to-date with Ruby on Rails?

Join 73,723+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.

    Screencast tutorials to help you learn Ruby on Rails, Javascript, Hotwire, Turbo, Stimulus.js, PostgreSQL, MySQL, Ubuntu, and more. Icons by Icons8

    © 2023 GoRails, LLC. All rights reserved.