Ask A Question

Notifications

You’re not receiving notifications from this thread.

I am receiving this error "BlogPostsController#index is missing a template for request formats: text/html"

Roman Vetter asked in Rails

What I need help with is this - my file path seems correct, however, my views/layouts are not separate. My file path is: app> views> layouts> blog_posts> index.html.erb

What I am wondering is this - should my views and layouts be separate? If so, how do I separate them? I think it's looking in the wrong area possibly because views/layouts are separate? Maybe I'm way off base here. Idk.

If anyone can lend a hand or at least point me in right google direction, it would be greatly appreciated.

Reply

You can have a blog_posts layout however, the structure that you probably want here is the following:
app > views > blog_posts > index.html.erb

Reply

Thank you for your response. I am unable to get that structure because I can't separate layout from views. Do you know how I would go about that by chance?

Reply

in the video, he has views and layouts separated. How can I do the same?

Reply
Join the discussion
Create an account Log in

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

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

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