-
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.
Merge branch 'sprint2-issue9#CRUD-Implementation' of https://github.c…
…om/BrightCoders-Institute/s10a1-proyecto-final-team-03-s10a1-proyecto-final into sprint2-issue9#CRUD-Implementation
- Loading branch information
Showing
14 changed files
with
99 additions
and
34 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,5 +1,6 @@ | ||
class MainController < ApplicationController | ||
before_action :authenticate_user! | ||
def home | ||
@posts = Post.all | ||
end | ||
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,29 @@ | ||
<h1>Main#home</h1> | ||
<p>Find me in app/views/main/home.html.erb</p> | ||
<h1>Feed del usuario <%= current_user.id %></h1> | ||
<%= Date.today %> | ||
<p>Esto es un template para probar funcionalidades, el diseño se modificará después.</p> | ||
|
||
<%= button_to 'Sign Out', destroy_user_session_path, method: :delete %> | ||
|
||
|
||
<%= link_to new_post_path do%> | ||
<div style="margin-top: 1rem;"> | ||
<span>Create a new post</span> | ||
</div> | ||
<%end%> | ||
<% @posts.each do |post| %> | ||
<div class='post' style="background-color: antiquewhite;"> | ||
<h2> <%=post.body%> </h2> | ||
<h3> Este es el post <%=post.id%> y pertenezo al usuario <%=post.user_id%> </h3> | ||
<%= link_to post_path(post.id) do%> | ||
<span>Details</span> | ||
<%end%> | ||
|
||
<%= link_to edit_post_path(post.id) do%> | ||
<div>Edit</div> | ||
<%end%> | ||
|
||
<%= button_to post_path(post.id), method: :delete do%> | ||
<span>Delete</span> | ||
<%end%> | ||
</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,13 @@ | ||
<h2 class="mt-0"><%= title %></h2> | ||
<%= form_with(model: @post) do |form| %> | ||
|
||
<div> | ||
<%= form.label :body, style: "display: block" %> | ||
<%= form.text_field :body %> | ||
</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 @@ | ||
<%= render 'form', event: @event, title: 'Edit post' %> |
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,12 +1 @@ | ||
<%= form_with(model: @post) do |form| %> | ||
|
||
<div> | ||
<%= form.label :body, style: "display: block" %> | ||
<%= form.text_field :body %> | ||
</div> | ||
|
||
<div> | ||
<%= form.submit %> | ||
</div> | ||
|
||
<% end %> | ||
<%= render 'form', event: @event, title: 'New post' %> |
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 +1,2 @@ | ||
<h1> Hola </h1> | ||
<h1>Publicación de <%= current_user.email %></h1> | ||
<h2><%=@post.body%></h2> |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.