ruby - Rails - Serve static CSV file as assets in Development with Thin -


i'm trying write csv file in dev thin, continually getting error says no such file or directory - http://localhost:3000/assets/tplan_log.csv

however, config looks this:

development.rb

config.serve_static_assets = true

and controller looks this:

def csv    #this returns valid path    log_path = view_context.asset_path 'plan_log.csv'     #error occurs here    csv.open(log_path) |csv|      csv << ["row","row1","row2"]    end    respond_to |format|     format.js {render json: @diaggroup.errors, status: :unprocessable_entity}   end end 

rails 3.2.12

edit: clarify, i'm looking answer on how serve file in development accessible. know it's being served asset pipeline, there no method associated it, it's not able accessed.

this ended being issue reference.

i using reference such as:

http://path/to/file.jpg

rails wants:

/path/to/file.jpg


Comments

Popular posts from this blog

Why can rails not find a route created by a helper? -

javascript - jquery or ashx not working -

opencv - DataType<cv::detail::deriv_type>::depth what is it used for -