-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathref_hash_fun.rb
More file actions
37 lines (29 loc) · 1.02 KB
/
ref_hash_fun.rb
File metadata and controls
37 lines (29 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
post '/users' do
@user = User.create(params[:user_info])
session[:user_id] = @user.id
redirect '/dogs'
end
<div class="container">
<h2> Create an Account </h2>
<form id="sign-up" action="/users" method="post">
<input type="text" name="user_info[name]" placeholder="username">
<input type="password" name="user_info[password]" placeholder="password">
<input type="password2" name="password2" placeholder="password">
<input type="submit" value="Get some puppies!">
</form>
</div>
params = {
user_info: {name: "", password: " "} ,
password2: ""
}
# ------------------------------------------------------]
User.create(name: params[:name], password: params[:password])
<div class="container">
<h2> Create an Account </h2>
<form id="sign-up" action="/users" method="post">
<input type="text" name="name" placeholder="username">
<input type="password" name="password" placeholder="password">
<input type="submit" value="Get some puppies!">
</form>
</div>
params = { name: "", password: " "}