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