controllers: set @current_item globally in respond_with.
This commit is contained in:
@@ -214,10 +214,10 @@ module ApplicationHelper
|
||||
render "table_builder/table", table: table
|
||||
end
|
||||
|
||||
def body_attributes(user = CurrentUser.user, current_item = nil)
|
||||
def body_attributes(user, params, current_item = nil)
|
||||
current_user_data_attributes = data_attributes_for(user, "current-user", current_user_attributes)
|
||||
|
||||
if current_item.present?
|
||||
if params[:action] == "show" && current_item.present?
|
||||
model_name = current_item.model_name.singular.dasherize
|
||||
model_attributes = current_item.html_data_attributes
|
||||
current_item_data_attributes = data_attributes_for(current_item, model_name, model_attributes)
|
||||
|
||||
Reference in New Issue
Block a user