diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 2b5c010..045b7e0 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -21,4 +21,8 @@ module ApplicationHelper } }.to_json.html_safe if weather_art.image.attached? end + + def admin? + current_user&.admin? + end end diff --git a/app/views/cities/_admin_panel.html.erb b/app/views/cities/_admin_panel.html.erb new file mode 100644 index 0000000..bcc918c --- /dev/null +++ b/app/views/cities/_admin_panel.html.erb @@ -0,0 +1,45 @@ +<% if admin? %> +