bug(rails): fix incompatibility with Rails 5
This commit is contained in:
@@ -9,7 +9,7 @@ class AdminController < ApplicationController
|
||||
if params[:field].nil?
|
||||
fields = "*"
|
||||
else
|
||||
fields = params[:field].map {|k,v| k }.join(",")
|
||||
fields = custom_fields.join(",")
|
||||
end
|
||||
|
||||
if params[:ip]
|
||||
@@ -61,6 +61,11 @@ class AdminController < ApplicationController
|
||||
|
||||
private
|
||||
|
||||
def custom_fields
|
||||
params.require(:field).keys
|
||||
end
|
||||
helper_method :custom_fields
|
||||
|
||||
def admin_param
|
||||
params[:admin_id] != '1'
|
||||
end
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
<thead>
|
||||
<tr>
|
||||
<%
|
||||
count = (params[:field] ? (params[:field].count+1) : 6)
|
||||
count = (params[:field] ? (custom_fields.count+1) : 6)
|
||||
count.times do %>
|
||||
<th> </th>
|
||||
<% end %>
|
||||
|
||||
Reference in New Issue
Block a user