Im trying to render a specific layout when the form is NOT properly filled:
Inside my views/layouts I've:
- application.html.erb
- empty.html.erb
My controller:
class UsersController < ApplicationController def new @user = User.new render layout: "empty" # I wan to re-use this layout is the user is not been saved end def create @user = User.new(user_params) if @user.save redirect_to sign_in_path else render :new end end def user_params params.require(:user).permit! end end The thing is that it works it re-renders the new-action when it's not true BUT it uses Application-default layout and NOT the other layout-file called: empty.html.erb
According to Rails guide lines it should work...but not for me :(
Thanks for your time