0
这是我.erb文件:非常基本的eRuby的形式问题:无法获取提交按钮做任何事情
<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上运行。)