首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >缺少使用Rails 4.2.4/4.0 0.14.6和Design4.0/babel-core 6.7.4/webpack 1.12.14的模板

缺少使用Rails 4.2.4/4.0 0.14.6和Design4.0/babel-core 6.7.4/webpack 1.12.14的模板
EN

Stack Overflow用户
提问于 2016-04-23 22:16:00
回答 1查看 104关注 0票数 1

我在我的测试应用程序中添加了Design4.0(这是一种灵活的身份验证解决方案),它运行得非常好。但是,当我在索引视图中编写更新概要文件的选项时。我得到了以下错误:

缺少模板配置文件/更新,应用程序/更新与{:locale=>:en,:formats=>:html,:variants=>[],:handlers=>:erb,:builder,:raw,:ruby,:jbuilder}。搜索:* "/Users/jalanya/Documents/dev/ruby/twitter-clone/app/views“* "/Users/jalanya/.rvm/gems/ruby-2.2.2/gems/devise-4.0.0/app/views”

现在,我只有一个名为"index.html.erb“的文件夹视图/配置文件下面的视图。那么,我的问题是,是否应该为操作"profile#update“添加另一个视图模板?如果是的话,我怎样才能做到呢?

我有我的测试应用程序在github,如果你想测试以及。请在下面找到我到目前为止拥有的文件。

routes.rb

代码语言:javascript
复制
Rails.application.routes.draw do

  get 'profile' => 'profile#index'
  post 'profile' => 'profile#update'

  devise_for :users
  root 'home#index'
end

profile_controller.rb

代码语言:javascript
复制
class ProfileController < ApplicationController
  before_action :authenticate_user!
  def index
  end
  def update
  end
end

views/profile/index.html.erb

代码语言:javascript
复制
<h2>Update profile</h2>
<%= form_tag "/profile" do %>
  <div class="row">
    <form class="col s12">
      <div class="row">
        <div class="input-field col s6">
          <input name="first_name" id="first_name" type="text" class="validate">
          <label for="first_name">First Name</label>
        </div>
        <div class="input-field col s6">
          <input name="last_name" id="last_name" type="text" class="validate">
          <label for="last_name">Last Name</label>
        </div>
        </div>
      <div class="row">
        <button type="submit" class="btn right">Save</button>
      </div>
    </form>
   </div>
<% end %>

请告诉我你的反馈。

EN

回答 1

Stack Overflow用户

发布于 2016-04-24 04:32:29

您需要在路由文件中添加更新视图或注释掉该行。现在,您正在告诉路由关于一个不存在的视图。

要添加它,您可以输入"rails生成视图“或手动进行。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/36817079

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档