- Introduce ArtsController with index action - Create index view for displaying weather arts - Implement Kaminari for pagination functionality - Add necessary routes for accessing arts - Update Gemfile to include Kaminari gem - Create views for pagination controls This implementation enhances the Weather Arts Gallery, allowing users to view and navigate through a collection of AI-generated weather arts easily. Pagination controls have been added to improve usability.
9 lines
301 B
Ruby
9 lines
301 B
Ruby
class ArtsController < ApplicationController
|
|
def index
|
|
@weather_arts = WeatherArt.includes(:city, city: [ :country, { country: :region } ])
|
|
.order(created_at: :desc)
|
|
.page(params[:page])
|
|
.per(2)
|
|
end
|
|
end
|