Skip to content

Commit

Permalink
Bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
eliseuramos93 committed Feb 16, 2024
1 parent b256f26 commit 27aed0d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
6 changes: 1 addition & 5 deletions app/controllers/advertisements_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,7 @@ def new
def create
@advertisement = current_user.advertisements.build(ads_params)

if @advertisement.save
redirect_to advertisement_path(@advertisement), notice: t('.success')
else
render 'new', status: :unprocessable_entity
end
redirect_to advertisement_path(@advertisement), notice: t('.success') if @advertisement.save
end

def show
Expand Down
10 changes: 5 additions & 5 deletions app/views/shared/_navbar.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,11 @@
<li class="dropdown-item" href="#">
<%= link_to t('settings.index.settings'), profile_settings_path(current_user.profile), class: 'nav-link' %>
</li>
<% if current_user.admin? %>
<li class="dropdown-item">
<%= link_to t('ads_btn'), advertisements_path, class: 'nav-link' %>
</li>
<% end %>
<div class="dropdown-divider"></div>
<li class="dropdown-item" href="#">
<%= link_to Subscription.model_name.human, subscriptions_path, class: 'nav-link text-primary' %>
Expand All @@ -79,11 +84,6 @@
<li class="dropdown-item">
<%= link_to InvitationRequest.model_name.human(count: 2), invitation_requests_path, class: 'nav-link text-primary' %>
</li>
<% if current_user.admin? %>
<li class="dropdown-item">
<%= link_to t('ads_btn'), advertisements_path, class: 'nav-link text-primary' %>
</li>
<% end %>
<li class="dropdown-item" href="#">
<%= button_to t('log_out'), destroy_user_session_path, method: :delete, class: 'btn btn-danger w-100' %>
</li>
Expand Down

0 comments on commit 27aed0d

Please sign in to comment.