Skip to content

Instantly share code, notes, and snippets.

@Wendersonandes
Last active September 4, 2023 21:25
Show Gist options
  • Save Wendersonandes/f42a221df1d3fd5e495fd37ae73379a3 to your computer and use it in GitHub Desktop.
Save Wendersonandes/f42a221df1d3fd5e495fd37ae73379a3 to your computer and use it in GitHub Desktop.
A note about default layout on rails

Rails take the controller name and devise/sessions, devise/registrations etc inherit from the controller Devise. That way you can just stick with devise.html.erb as layout for every controller inside devise.

You can test that behaviour and create layout layouts/posts.html.erb and you will see that every action inside posts_controller will be using that as far as you will be not changing that :)

application_controller is the reason why application layout is default when you are not using some from inherited controller names.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment