Skip to content

Instantly share code, notes, and snippets.

@oranges13
oranges13 / RegistrationController.php
Created April 23, 2018 16:21
Populate external drop downs for datatable filtering
/**
* Process datatables ajax request.
*
* @return \Illuminate\Http\JsonResponse
*/
public function allData(Request $request)
{
$registrations = Registration::with('product')->with('reg_type')->select('registrations.*');
$datatable = Datatables::of($registrations);
@oranges13
oranges13 / test.patch
Last active December 28, 2017 22:30
context 3.7 patch heirarchy fix
diff --git a/plugins/context_condition_menu.inc b/plugins/context_condition_menu.inc
index 4b19e02..7582497 100644
--- a/plugins/context_condition_menu.inc
+++ b/plugins/context_condition_menu.inc
@@ -1,5 +1,7 @@
<?php
+require_once('context_menu_helpers.inc');
+
/**
@oranges13
oranges13 / gist:e4fe7d7a5cef230fff92d81e7b75cb85
Created December 7, 2016 04:23
Padrino Nomethoderror block in named routes when running `padrino rake routes`
/home/username/.rvm/gems/ruby-2.3.1@portal/gems/padrino-core-0.13.2/lib/padrino-core/mounter.rb:133:in `block in named_routes': undefined method `name' for #<Array:0x0000000281d5b0> (NoMethodError)
from /home/username/.rvm/gems/ruby-2.3.1@portal/gems/padrino-core-0.13.2/lib/padrino-core/mounter.rb:132:in `each'
from /home/username/.rvm/gems/ruby-2.3.1@portal/gems/padrino-core-0.13.2/lib/padrino-core/mounter.rb:132:in `map'
from /home/username/.rvm/gems/ruby-2.3.1@portal/gems/padrino-core-0.13.2/lib/padrino-core/mounter.rb:132:in `named_routes'
from /home/username/.rvm/gems/ruby-2.3.1@portal/gems/padrino-core-0.13.2/lib/padrino-core/cli/rake_tasks.rb:24:in `list_app_routes'
from /home/username/.rvm/gems/ruby-2.3.1@portal/gems/padrino-core-0.13.2/lib/padrino-core/cli/rake_tasks.rb:54:in `block (2 levels) in <top (required)>'
from /home/username/.rvm/gems/ruby-2.3.1@portal/gems/padrino-core-0.13.2/lib/padrino-core/cli/rake_tasks.rb:53:in `each'
from /home/username/.rvm/gems/ruby-2.3.1@portal/gems/padrino-