Skip to content

Instantly share code, notes, and snippets.

@AJFaraday
Last active December 19, 2015 07:09
Show Gist options
  • Save AJFaraday/5916888 to your computer and use it in GitHub Desktop.
Save AJFaraday/5916888 to your computer and use it in GitHub Desktop.
routing issue
# server log
Started POST "/dashboards/33/fill_portlet_form" for 127.0.0.1 at 2013-07-03 11:12:04 +0100
[ FATAL: 11:12:04.143]
LoadError (Expected /home/ajfaraday/biorails/develop_5.0/app/controllers/admin/dashboards_controller.rb to define DashboardsController):
# routing file
scope :module => "admin" do
resources :dashboards do
collection do
get :find_portlets
end
member do
post :fill_portlet_form
get :remove
post :add
end
end
end
# call
jQuery(document).on('change', '#portlet_id', function () {
jQuery.post('<%=fill_portlet_form_dashboard_path(@dashboard) %>',
jQuery("#portlet_form").serialize(),
function (result) {
jQuery('#portlet_form_holder').html(result);
jQuery('#portlet_form_holder').dialog('option','height','auto');
jQuery('#portlet_form_holder').dialog('option','maxHeight',500);
}, 'html'
);
});
# rake routes
fill_portlet_form_dashboard POST /dashboards/:id/fill_portlet_form(.:format) {:action=>"fill_portlet_form", :controller=>"admin/dashboards"}
# parameters being passed up
{"utf8"=>"✓", "_method"=>"put",
"authenticity_token"=>"pbx/C7yJqNKTdK7McVqUOy91P8E3XIB25CBL+kJvtHY=",
"form_action"=>"",
"back_url"=>"",
"dashboard"=>{
"dashboard_portlets_attributes"=>
{"0"=>{"weight"=>"0", "hide"=>"", "_destroy"=>"", "current"=>"", "zone"=>"top", "portlet_id"=>"folder_summary", "id"=>"10416"},
"1"=>{"weight"=>"1", "hide"=>"", "_destroy"=>"", "current"=>"", "zone"=>"top", "portlet_id"=>"folder_content", "id"=>"10419"},
"2"=>{"weight"=>"", "hide"=>"true", "_destroy"=>"", "current"=>"true", "zone"=>"top", "portlet_id"=>"assigned_queues"}
}
},
"id"=>"fill_portlet_form"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment