yooo this is sick

This commit is contained in:
2024-08-08 11:19:44 +02:00
parent ffc09cabc4
commit aa0811e25d
22 changed files with 226 additions and 33 deletions

View File

@@ -1,3 +1,12 @@
<% if logged_in? %>
<p>Logged in as <%= current_user.username %></p>
<p><%= link_to "Log out", logout_path, data: {
turbo_method: :delete
} %></p>
<% else %>
<p><%= link_to "Log in", login_path %> or <%= link_to "Sign up", signup_path %></p>
<% end %>
<h1>Articles!</h1>
Our blog has <%= Article.public_count %> articles and counting!

View File

@@ -2,13 +2,15 @@
<p><%= @article.body %></p>
<ul>
<li><%= link_to "Edit", edit_article_path(@article) %></li>
<li><%= link_to "Destroy", article_path(@article), data: {
turbo_method: :delete,
turbo_confirm: "Are you sure?"
} %></li>
</ul>
<% if logged_in? && @article.user_id == current_user.id %>
<ul>
<li><%= link_to "Edit", edit_article_path(@article) %></li>
<li><%= link_to "Destroy", article_path(@article), data: {
turbo_method: :delete,
turbo_confirm: "Are you sure?"
} %></li>
</ul>
<% end %>
<h2>Comments</h2>
<%= render @article.comments %>