这是在我的 .erb 文件中:
<form method="post" action="/login" id="login" enctype="text/plain">
Username: <input type="text" id="username" placeholder="Enter username here">
Password: <input type="password" id="password" placeholder="Enter password here">
<%= @error (will display if wrong) %>
<input TYPE="button" VALUE="Submit" />
</form>
这是在我的 .rb 文件中:
post '/login' do
#connects to database
if #connection successful
# does something
else
#do something else
end
end
但是,当我尝试单击“提交”按钮登录时,没有任何反应。最初我连接到数据库并检查信息,但之后我只是试图将错误消息设置为某个值,即使这样也行不通。我知道这是我想念的愚蠢的东西。哪一块没有?(将 Postgres 与 Eruby 一起使用,它在 Heroku 上运行。)