app/controllers/entities/itineraries_controller.rb
# GET /itineraries/redraw                                                   AJAX
#----------------------------------------------------------------------------
GET /itineraries/redraw                                                   AJAX
GET / itineraries / redraw AJAX
def redraw
    current_user.pref[:itineraries_per_page] = params[:per_page] if params[:per_page]
    current_user.pref[:itineraries_sort_by]  = Itinerary.sort_by_map[params[:sort_by]] if params[:sort_by]
    @itineraries = get_itineraries(page: 1, per_page: params[:per_page])
    set_options 
    respond_with(@itineraries) do |format|
      format.js { render :index }
    end
  end
def redraw current_user . pref [ :itineraries_per_page ] = params [ :per_page ] if params [ :per_page ] current_user . pref [ :itineraries_sort_by ] = Itinerary . sort_by_map [ params [ :sort_by ] ] if params [ :sort_by ] @itineraries = get_itineraries ( page : 1 , per_page : params [ :per_page ] ) set_options respond_with ( @itineraries ) do | format | format . js { render :index } end end
GET /itineraries/redraw                                                   AJAX
GET / itineraries / redraw AJAX
# Refresh options