title: rendering specific layout rails
body: <p>Im trying to render a specific layout when the form is NOT properly filled:</p>
  
  <p>Inside my views/layouts I've:</p>
  
  <ul>
  <li>application.html.erb </li>
  <li>empty.html.erb</li>
  </ul>
  
  <p>My controller: </p>
  
  <pre><code>class UsersController &lt; 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
  </code></pre>
  
  <p>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: <strong>empty.html.erb</strong></p>
  
  <p>According to  <a href="http://guides.rubyonrails.org/layouts_and_rendering.html" rel="nofollow">Rails guide lines</a> it should work...but not for me :( </p>
  
  <p>Thanks for your time</p>