diff --git a/app/assets/stylesheets/wow_reputations.scss b/app/assets/stylesheets/wow_reputations.scss new file mode 100644 index 0000000..e8f8968 --- /dev/null +++ b/app/assets/stylesheets/wow_reputations.scss @@ -0,0 +1,3 @@ +// Place all the styles related to the WowReputation controller here. +// They will automatically be included in application.css. +// You can use Sass (SCSS) here: https://sass-lang.com/ diff --git a/app/controllers/wow_reputations_controller.rb b/app/controllers/wow_reputations_controller.rb new file mode 100644 index 0000000..ef2e11e --- /dev/null +++ b/app/controllers/wow_reputations_controller.rb @@ -0,0 +1,9 @@ +class WowReputationsController < ProtectedController + def index + @pagy, @wow_reputations = pagy(WowReputation.non_meta_reputations, items: 20) + end + + def show + @wow_reputation = WowReputation.find(params[:id]) + end +end diff --git a/app/helpers/wow_reputations_helper.rb b/app/helpers/wow_reputations_helper.rb new file mode 100644 index 0000000..3e532b6 --- /dev/null +++ b/app/helpers/wow_reputations_helper.rb @@ -0,0 +1,2 @@ +module WowReputationsHelper +end diff --git a/app/models/wow_reputation.rb b/app/models/wow_reputation.rb index 16ee3d6..e561e8a 100644 --- a/app/models/wow_reputation.rb +++ b/app/models/wow_reputation.rb @@ -11,5 +11,6 @@ class WowReputation < ApplicationRecord validates :name, presence: true validates :reputation_id, presence: true, uniqueness: true - scope :meta_reputations, -> { where(meta_wow_reputation: nil) } + scope :meta_reputations, -> { where(description: nil) } + scope :non_meta_reputations, -> { where.not(description: nil) } end diff --git a/app/views/layouts/_navbar.html.erb b/app/views/layouts/_navbar.html.erb index 35740f8..a13854b 100644 --- a/app/views/layouts/_navbar.html.erb +++ b/app/views/layouts/_navbar.html.erb @@ -5,13 +5,16 @@ <% if user_signed_in? %>