style: format code style in Gemfile and controllers
- Adjust spacing around the quotes in the Gemfile - Standardize spacing in the arts_controller for improved readability - Modify routes file for consistent array formatting These changes enhance the consistency of code style across the project without altering any functionality or behavior.
This commit is contained in:
parent
f33fb4d2ba
commit
bafb90f5fb
2
Gemfile
2
Gemfile
@ -45,7 +45,7 @@ gem "devise", "~> 4.9"
|
|||||||
gem "activeadmin", "~> 3.2"
|
gem "activeadmin", "~> 3.2"
|
||||||
gem "friendly_id", "~> 5.5"
|
gem "friendly_id", "~> 5.5"
|
||||||
|
|
||||||
gem 'kaminari', '~> 1.2'
|
gem "kaminari", "~> 1.2"
|
||||||
|
|
||||||
# gem "whenever", "~> 1.0"
|
# gem "whenever", "~> 1.0"
|
||||||
gem "ruby-openai", "~> 7.3"
|
gem "ruby-openai", "~> 7.3"
|
||||||
|
@ -3,14 +3,14 @@ class ArtsController < ApplicationController
|
|||||||
@regions = Region.all
|
@regions = Region.all
|
||||||
@current_region = Region.find(params[:region]) if params[:region].present?
|
@current_region = Region.find(params[:region]) if params[:region].present?
|
||||||
|
|
||||||
@weather_arts = WeatherArt.includes(city: [:country, { country: :region }])
|
@weather_arts = WeatherArt.includes(city: [ :country, { country: :region } ])
|
||||||
|
|
||||||
if @current_region
|
if @current_region
|
||||||
@weather_arts = @weather_arts.joins(city: :country)
|
@weather_arts = @weather_arts.joins(city: :country)
|
||||||
.where(countries: { region_id: @current_region.id })
|
.where(countries: { region_id: @current_region.id })
|
||||||
end
|
end
|
||||||
|
|
||||||
@weather_arts = if params[:sort] == 'oldest'
|
@weather_arts = if params[:sort] == "oldest"
|
||||||
@weather_arts.order(created_at: :asc)
|
@weather_arts.order(created_at: :asc)
|
||||||
else
|
else
|
||||||
@weather_arts.order(created_at: :desc)
|
@weather_arts.order(created_at: :desc)
|
||||||
|
@ -6,7 +6,7 @@ Rails.application.routes.draw do
|
|||||||
resources :cities, only: [ :index, :show ] do
|
resources :cities, only: [ :index, :show ] do
|
||||||
resources :weather_arts, path: "weather", only: [ :show ], param: :slug
|
resources :weather_arts, path: "weather", only: [ :show ], param: :slug
|
||||||
end
|
end
|
||||||
resources :arts, only: [:index]
|
resources :arts, only: [ :index ]
|
||||||
|
|
||||||
# namespace :admin do
|
# namespace :admin do
|
||||||
# resources :cities
|
# resources :cities
|
||||||
|
Loading…
Reference in New Issue
Block a user