Where to put images?

I keep getting this error:

ActionController::RoutingError (No route matches “/imgs/sky_blue_grid.gif”):

ActionController::RoutingError (No route matches “/images/dhtmlx/imgs/sort_desc.gif”):

In my app/views/qtl_table/view/html.erb:

View all QTLs

var grid = new dhtmlXGridObject("grid_here"); //grid.setImagePath("../../public/images"); grid.setImagePath("/images/dhtmlx/imgs/"); grid.setHeader("QTL name, Parent 1, Parent 2"); grid.attachHeader("#text_filter,#text_filter,#text_filter"); //added ! grid.setColSorting("str,str,str"); //added ! grid.setSkin("dhx_skyblue"); grid.setInitWidths("100,100,*"); grid.init(); grid.load("/qtl_table/data.xml");
    <%- logger.debug "\n CREATE NEW DP\n"%>
    dp = new dataProcessor("/qtl_table/dbaction.xml/");
    <input type="button" value="Add" onclick="grid.addRow(grid.uid(),'new QTL')">
    <input type="button" value="Delete" onclick="grid.deleteSelectedRows()">

This command says to grid, that it can find it’s images in the target folder, you need to

a) create such folder in webroot and place there images from codebase/imgs in grid’s package ( of course you can adjust the name of folder )

b) if you are using rails 3.0 - you can point the above command to url which will give access to assetts of dhtmlxgrid.

Stanislav, could you expand more on option b) ? By url are you saying we’d give a full “http:localhost:3000/assets/codebase/imgs” ? I’m on Rails 3.2.11 and not figuring out the correct path for this grid.setImagePath issue


I’ve tried every combination of those directory levels, both as full URL and as paths, leaving off the localhost:3000/ part.

Please check the next comment in the blog