generated from FGA0138-MDS-Ajax/template-repository
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
inserção do campo senha no banco de dados
- Loading branch information
1 parent
7f00592
commit 26b11b9
Showing
29 changed files
with
210 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,2 @@ | ||
class Cargo < ApplicationRecord | ||
has_many :users | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<div id="<%= dom_id cargo %>"> | ||
<p> | ||
<strong>Nome:</strong> | ||
<%= cargo.nome %> | ||
</p> | ||
|
||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
json.extract! cargo, :id, :nome, :created_at, :updated_at | ||
json.url cargo_url(cargo, format: :json) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<%= form_with(model: cargo) do |form| %> | ||
<% if cargo.errors.any? %> | ||
<div style="color: red"> | ||
<h2><%= pluralize(cargo.errors.count, "error") %> prohibited this cargo from being saved:</h2> | ||
|
||
<ul> | ||
<% cargo.errors.each do |error| %> | ||
<li><%= error.full_message %></li> | ||
<% end %> | ||
</ul> | ||
</div> | ||
<% end %> | ||
|
||
<div> | ||
<%= form.label :nome, style: "display: block" %> | ||
<%= form.text_field :nome %> | ||
</div> | ||
|
||
<div> | ||
<%= form.submit %> | ||
</div> | ||
<% end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<h1>Editing cargo</h1> | ||
|
||
<%= render "form", cargo: @cargo %> | ||
|
||
<br> | ||
|
||
<div> | ||
<%= link_to "Show this cargo", @cargo %> | | ||
<%= link_to "Back to cargos", cargos_path %> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<p style="color: green"><%= notice %></p> | ||
|
||
<h1>Cargos</h1> | ||
|
||
<div id="cargos"> | ||
<% @cargos.each do |cargo| %> | ||
<%= render cargo %> | ||
<p> | ||
<%= link_to "Show this cargo", cargo %> | ||
</p> | ||
<% end %> | ||
</div> | ||
|
||
<%= link_to "New cargo", new_cargo_path %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
json.array! @cargos, partial: "cargos/cargo", as: :cargo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<h1>New cargo</h1> | ||
|
||
<%= render "form", cargo: @cargo %> | ||
|
||
<br> | ||
|
||
<div> | ||
<%= link_to "Back to cargos", cargos_path %> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<p style="color: green"><%= notice %></p> | ||
|
||
<%= render @cargo %> | ||
|
||
<div> | ||
<%= link_to "Edit this cargo", edit_cargo_path(@cargo) %> | | ||
<%= link_to "Back to cargos", cargos_path %> | ||
|
||
<%= button_to "Destroy this cargo", @cargo, method: :delete %> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
json.partial! "cargos/cargo", cargo: @cargo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
<%= form_with(model: user) do |form| %> | ||
<% if user.errors.any? %> | ||
<div style="color: red"> | ||
<h2><%= pluralize(user.errors.count, "error") %> prohibited this user from being saved:</h2> | ||
|
||
<ul> | ||
<% user.errors.each do |error| %> | ||
<li><%= error.full_message %></li> | ||
<% end %> | ||
</ul> | ||
</div> | ||
<% end %> | ||
|
||
<div> | ||
<%= form.label :nome, style: "display: block" %> | ||
<%= form.text_field :nome %> | ||
</div> | ||
|
||
<div> | ||
<%= form.label :matricula, style: "display: block" %> | ||
<%= form.text_field :matricula %> | ||
</div> | ||
|
||
<div> | ||
<%= form.label :email, style: "display: block" %> | ||
<%= form.text_field :email %> | ||
</div> | ||
|
||
<div> | ||
<%= form.label :senha, style: "display: block" %> | ||
<%= form.text_field :senha %> | ||
</div> | ||
|
||
<div> | ||
<%= form.label :cargo_id, style: "display: block" %> | ||
<%= form.text_field :cargo_id %> | ||
</div> | ||
|
||
<div> | ||
<%= form.submit %> | ||
</div> | ||
<% end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<div id="<%= dom_id user %>"> | ||
<p> | ||
<strong>Nome:</strong> | ||
<%= user.nome %> | ||
</p> | ||
|
||
<p> | ||
<strong>Matricula:</strong> | ||
<%= user.matricula %> | ||
</p> | ||
|
||
<p> | ||
<strong>Email:</strong> | ||
<%= user.email %> | ||
</p> | ||
|
||
<p> | ||
<strong>Senha:</strong> | ||
<%= user.senha %> | ||
</p> | ||
|
||
<p> | ||
<strong>Cargo:</strong> | ||
<%= user.cargo_id %> | ||
</p> | ||
|
||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
json.extract! user, :id, :nome, :matricula, :email, :senha, :cargo_id, :created_at, :updated_at | ||
json.url user_url(user, format: :json) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<h1>Editing user</h1> | ||
|
||
<%= render "form", user: @user %> | ||
|
||
<br> | ||
|
||
<div> | ||
<%= link_to "Show this user", @user %> | | ||
<%= link_to "Back to users", users_path %> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<p style="color: green"><%= notice %></p> | ||
|
||
<h1>Users</h1> | ||
|
||
<div id="users"> | ||
<% @users.each do |user| %> | ||
<%= render user %> | ||
<p> | ||
<%= link_to "Show this user", user %> | ||
</p> | ||
<% end %> | ||
</div> | ||
|
||
<%= link_to "New user", new_user_path %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
json.array! @users, partial: "users/user", as: :user |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<h1>New user</h1> | ||
|
||
<%= render "form", user: @user %> | ||
|
||
<br> | ||
|
||
<div> | ||
<%= link_to "Back to users", users_path %> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<p style="color: green"><%= notice %></p> | ||
|
||
<%= render @user %> | ||
|
||
<div> | ||
<%= link_to "Edit this user", edit_user_path(@user) %> | | ||
<%= link_to "Back to users", users_path %> | ||
|
||
<%= button_to "Destroy this user", @user, method: :delete %> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
json.partial! "users/user", user: @user |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters