Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/templates/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails 为登录和重新注册设计不同的布局_Ruby On Rails_Templates_Devise - Fatal编程技术网

Ruby on rails 为登录和重新注册设计不同的布局

Ruby on rails 为登录和重新注册设计不同的布局,ruby-on-rails,templates,devise,Ruby On Rails,Templates,Devise,我正在使用Desive with rails 4,希望为我的登录和注册页面应用自定义布局。我在我的应用程序_controller.rb代码中找到并使用了此代码- layout :layout_by_resource def layout_by_resource if devise_controller? && resource_name == :user && action_name == 'new' "devise" else

我正在使用Desive with rails 4,希望为我的登录和注册页面应用自定义布局。我在我的应用程序_controller.rb代码中找到并使用了此代码-

 layout :layout_by_resource 

  def layout_by_resource 
  if devise_controller? && resource_name == :user && action_name == 'new' 
    "devise" 
  else 
    "application" 
    end
 end

然而,这段代码给了我一个模板丢失错误

可能是您没有创建
app/views/layouts/designe.html.erb
模板文件。

请在您的问题中更具体一些。您想如何定制布局?