Skip to content

Commit b256f26

Browse files
committed
Style/Refatora estilo do anuncio
1 parent 5173ccd commit b256f26

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

app/controllers/advertisements_controller.rb

+5-3
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,11 @@ def new
1313
def create
1414
@advertisement = current_user.advertisements.build(ads_params)
1515

16-
return redirect_to advertisement_path(@advertisement), notice: t('.success') if @advertisement.save
17-
18-
render 'new', status: :unprocessable_entity
16+
if @advertisement.save
17+
redirect_to advertisement_path(@advertisement), notice: t('.success')
18+
else
19+
render 'new', status: :unprocessable_entity
20+
end
1921
end
2022

2123
def show

app/views/advertisements/_advertisement.html.erb

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<div id="advertisement_<%= advertisement.id %>" class="text-center mb-3">
22
<%= button_to advertisement_path(advertisement), method: :patch,
3-
class: 'advertisement', data: { turbo: false }, id: 'to-ad' do %>
3+
class: 'advertisement rounded btn btn-light w-100', data: { turbo: false }, id: 'to-ad' do %>
44
<p><%= advertisement.title %></p>
55
<p><%= image_tag advertisement.image, width: '400rem', alt: 'advertisement' if advertisement.image.present? %></p>
66
<% end %>

0 commit comments

Comments
 (0)