is there a way to render a file in another window
I wrote :
def show
@asset = Asset.find(params[:id])
respond_to do |format|
format.html
format.xml { render :xml => @asset }
format.pdf {render :file => @asset.data.path }
end
end
this render in the current window....
thanks for your suggestions
erwin
format.pdf {send_data(@asset, :filename => @asset.data.path, :type
=>''application/pdf'',:disposition =>
''inline'') }
Sijo
--
Posted via http://www.ruby-forum.com/.
Thanks Sijo I also found that I could use the :popup => true in the ''link_to'' On 20 juil, 12:45, Sijo Kg <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> format.pdf {send_data(@asset, :filename => @asset.data.path, :type > =>''application/pdf'',:disposition => ''inline'') } > > Sijo > > -- > Posted viahttp://www.ruby-forum.com/.
Reasonably Related Threads
- [Rails 3.2] form_tag w :remote => true doesn't fire up the js format
- Nested Forms - how to displayed the attributes content ?
- Rails 3.1 assets path for video player Flash script 'player.swf'
- render :json not sending any data back ...
- Rendering dynamic Gruff image (send_data)