You do not have permission to delete messages in this group
Copy link
Report message
Sign in to report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Refinery CMS
I don't understand this code, can someone explain please
Refinery::Admin::PagesController.class_eval dodefpage_params_with_my_params
page_params_without_my_params.merge(params.require(:page).permit(:background_image_id))
end
alias_method_chain :page_params, :my_paramsend
Philip Arndt
unread,
Jan 21, 2018, 5:02:50 PM1/21/18
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Sign in to report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to refine...@googlegroups.com
What this code is doing is overriding the default version of this method `page_params` with your own version that has custom functionality.
It's just adding more parameters to the list than exists by default to support a background_image_id parameter being passed to your controller via strong parameters.
Search 'alias_method_chain' for more information. This technique is more commonly done these days with `Module#prepend`.