One controller rendering using another controller’s views

Template rendering should actually work render :template => “question/answer” The problem you were having is from the partials looking in the wrong place. The fix is simple, just make your partials absolute in any shared templates. For example, question/answer.html.erb should have <%= render :partial => ‘question/some_partial’ %> rather than the usual <%= render :partial => … Read more

Integrate MuPDF Reader in an app

I don’t know how to do this in Windows using cygwin, because I’m using Ubuntu for the development. But I think the procedure should be the same. Download the file mupdf-0.9-source.tar.gz here: http://code.google.com/p/mupdf/downloads/list?q=source Download the file mupdf-thirdparty.zip Extract the sources. By default they will be extracted to the folder: mupdf-0.9/ Extract the file mupdf-thirdparty.zip into … Read more

WPF DataGrid is very slow to render

Are you have: Enabled VirtualizingStackPanel.VirtualizationMode for a Grid? if not – try to set. Set VirtualizingStackPanel.IsVirtualizing=”true” for DataGrid Wrapped up a Grid by a StackPanel container? If yes – try to remove. Wrapped up a Grid by an external ScrollViewer control? If yes – try to remove. One more point, could you bind whole items … Read more

Ruby on Rails – Render JSON for multiple models

One way you could do this is to create a hash with the objects you want to render, and then pass that to the render method. Like so: respond_to do |format| format.json { render :json => {:moulding => @moulding, :material_costs => @material_costs }} end If the models aren’t associated through active record, that’s probably your … Read more