app/controllers/digital_assets_controller.rb in daengine-0.6.5 vs app/controllers/digital_assets_controller.rb in daengine-0.6.8

- old
+ new

@@ -11,11 +11,13 @@ # GET /digital_assets # GET /digital_assets.json #/digital_assets/search/sami_code=92023 #/digital_assets/search/sami_code=NE00192&title=Fund%20Prospectus&fund_code=20293 def index - @digital_assets = request.query_parameters.present? ? search_da(request.query_parameters) : DigitalAsset.all - respond_with(@digital_assets) + search_params = params[:search] || request.query_parameters + @digital_assets = search_params ? search_da(search_params) : DigitalAsset.all + # respond_with(@digital_assets) + render json: @digital_assets end alias :search :index # GET /digital_assets/1 # GET /digital_assets/1.json