app/controllers/content_page_shares_controller.rb
# Only allow a trusted parameter "white list" through.
Only allow a trusted parameter "white list" through.
Only allow a trusted parameter " white list " through .
def content_page_share_params
    {
      content_page_type: params.require(:content_page_share).require(:content_page).split('-').first,
      content_page_id:   params.require(:content_page_share).require(:content_page).split('-').second,
      message:           params.require(:content_page_share).permit(:message).fetch('message', ''),
      user_id:           current_user.id,
      shared_at:         DateTime.current
    }
  end
def content_page_share_params { content_page_type : params . require ( :content_page_share ) . require ( :content_page ) . split ( '-' ) . first , content_page_id : params . require ( :content_page_share ) . require ( :content_page ) . split ( '-' ) . second , message : params . require ( :content_page_share ) . permit ( :message ) . fetch ( 'message' , '' ) , user_id : current_user . id , shared_at : DateTime . current } end
Only allow a trusted parameter "white list" through.
Only allow a trusted parameter " white list " through .