Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Open Source > Ruby
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Ruby section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old October 15th, 2007, 11:48 AM
Registered User
 
Join Date: Oct 2007
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default In Rails how to link to text file

I'm trying to figure a way to create a link to a word file or
a pdf. When I click on the link it would be fine if the file
opened up in it's own window outside of the browser. I haven't
found any examples of this.

Reply With Quote
  #2 (permalink)  
Old October 16th, 2007, 09:22 AM
Friend of Wrox
Points: 1,515, Level: 15
Points: 1,515, Level: 15 Points: 1,515, Level: 15 Points: 1,515, Level: 15
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Dec 2003
Location: Oxford, , United Kingdom.
Posts: 488
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Put my_document.pdf into the public/resource directory.

In your template do:
Code:
<%= link_to 'My Document', '/resource/my_document.pdf' -%>
--
Charlie Harvey's website - linux, perl, java, anarchism and punk rock: http://charlieharvey.org.uk
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Link a text file to Access using VBA wscheiman Access VBA 1 June 30th, 2013 07:02 PM
Beginning Ruby on Rails - chapter 11: Ajax & Rails rornet BOOK: Beginning Ruby on Rails 1 June 22nd, 2007 04:10 PM
make link in text area saban ASP.NET 1.0 and 1.1 Basics 7 November 15th, 2006 10:18 AM
insert text into a text box by selecting an link gavmc Other Programming Languages 0 February 15th, 2006 08:46 AM
Autofill text from an Email Link zanna5910 Access 1 September 28th, 2005 07:13 PM



All times are GMT -4. The time now is 04:47 PM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.