Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/heroku/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
无法在heroku上使用Rails应用程序创建用户,但在localhost上可以完美运行_Heroku_Ruby On Rails 4 - Fatal编程技术网

无法在heroku上使用Rails应用程序创建用户,但在localhost上可以完美运行

无法在heroku上使用Rails应用程序创建用户,但在localhost上可以完美运行,heroku,ruby-on-rails-4,Heroku,Ruby On Rails 4,因此,我正在通过Michael Hartl tut进行工作,该应用程序在本地主机上运行良好,但在我部署到heroku的那一刻,当我提交信息时,它不会创建用户。事实上,它只是坐在那里,好像我只是点击了一个空屏幕,没有错误消息,也没有重拨。我查看了heroku日志,没有发现任何异常被记录。我尝试更新控制器行为,但得到了相同的结果。这令人沮丧 我的表单如下所示: <div class="main-form"> <%= form_for(@user) do |f| %&

因此,我正在通过Michael Hartl tut进行工作,该应用程序在本地主机上运行良好,但在我部署到heroku的那一刻,当我提交信息时,它不会创建用户。事实上,它只是坐在那里,好像我只是点击了一个空屏幕,没有错误消息,也没有重拨。我查看了heroku日志,没有发现任何异常被记录。我尝试更新控制器行为,但得到了相同的结果。这令人沮丧

我的表单如下所示:

  <div class="main-form">  
    <%= form_for(@user) do |f| %>
    <%= render 'shared/error_messages'%>
    <%= f.label :name %>
    <%= f.text_field :name, class: "active" %><br/>

    <%= f.label :email %>
    <%= f.text_field :email %><br/>

    <%= f.label :password %>
    <%= f.password_field :password %><br/>

    <%= f.label :password_confirmation %>
    <%= f.password_field :password_confirmation %><br/>
  </div>
  <div class="actions">
    <%= f.submit "create my account", class: "btn btn-lg btn-default" %>
  </div>
  <% end %>

这两种方法都不管用?欢迎提供任何建议。

如果您查看页面,您的提交按钮似乎超出了表单定义:


如果你想测试这个应用,你可以去感谢你的关注。像许多其他人一样,我对开发还不熟悉,不知道如何充分利用manny工具。只是不确定它在我的本地环境上是如何工作的,但在heroku上不是。
class UsersController < ApplicationController
  def new
  end

  def show
   @user = User.find(params[:id])
   @title = @user.name
  end

  def create
   @title = "welcome"
   @user = User.new(user_params)
   if @user.password_confirmation.empty? == false 
    @user.save
    redirect_to user_path(@user)
   else
    render 'new'
   end
  end

  private

  def user_params 
   params.require(:user).permit(:name, :email, :password, :password_confirmation)
  end
 end
def create
 @user = User.new(user_params)
 if @user.save
  redirect_to @user
 else
  render 'new'
 end
end