app/controllers/dashboard_controller.rb
# Destroy and recreate a user's dashboard from the default
Destroy and recreate a user's dashboard from the default
Destroy and recreate a user ' s dashboard from the default
def reset_widgets
    assert_privileges("dashboard_reset")
    ws = MiqWidgetSet.where_unique_on(@sb[:active_db], current_user).first
    ws.destroy unless ws.nil?
    ws = create_user_dashboard(@sb[:active_db_id])
    @sb[:dashboards] = nil  
    render :update do |page|
      page.redirect_to :action => 'show'
    end
  end
def reset_widgets assert_privileges ( "dashboard_reset" ) ws = MiqWidgetSet . where_unique_on ( @sb [ :active_db ] , current_user ) . first ws . destroy unless ws . nil? ws = create_user_dashboard ( @sb [ :active_db_id ] ) @sb [ :dashboards ] = nil render :update do | page | page . redirect_to :action => 'show' end end
Destroy and recreate a user's dashboard from the default
Destroy and recreate a user ' s dashboard from the default
# Reset dashboards hash so it gets recreated