artist: fix /artists?name=<name> search.
This commit is contained in:
@@ -37,6 +37,9 @@ class ArtistsController < ApplicationController
|
|||||||
end
|
end
|
||||||
|
|
||||||
def index
|
def index
|
||||||
|
# XXX
|
||||||
|
params[:search][:name] = params.delete(:name) if params[:name]
|
||||||
|
|
||||||
@artists = Artist.includes(:urls).paginated_search(params)
|
@artists = Artist.includes(:urls).paginated_search(params)
|
||||||
@artists = @artists.includes(:tag) if request.format.html?
|
@artists = @artists.includes(:tag) if request.format.html?
|
||||||
@artists = @artists.includes(:urls) if !request.format.html?
|
@artists = @artists.includes(:urls) if !request.format.html?
|
||||||
@@ -100,12 +103,6 @@ private
|
|||||||
@artist = Artist.find(params[:id])
|
@artist = Artist.find(params[:id])
|
||||||
end
|
end
|
||||||
|
|
||||||
def search_params
|
|
||||||
sp = params.fetch(:search, {})
|
|
||||||
sp[:name] = params[:name] if params[:name]
|
|
||||||
sp.permit!
|
|
||||||
end
|
|
||||||
|
|
||||||
def artist_params(context = nil)
|
def artist_params(context = nil)
|
||||||
permitted_params = %i[name other_names other_names_string group_name url_string notes]
|
permitted_params = %i[name other_names other_names_string group_name url_string notes]
|
||||||
permitted_params << :is_active if CurrentUser.is_builder?
|
permitted_params << :is_active if CurrentUser.is_builder?
|
||||||
|
|||||||
Reference in New Issue
Block a user