How do i access a file in the public directory of rails application? I have several html files in there and i want to link them from the rhtml file. Basically to display a popup. Here is the code in foo.rhtml: <a href="javascript:popUp(''/summary.html'')" class="normal">Learn more</a> It doesn''t work. Any idea why? Thanks, Lantis. -- Posted via http://www.ruby-forum.com/.
Lantis Sephiro wrote:> How do i access a file in the public directory of rails application? I > have several html files in there and i want to link them from the rhtml > file. Basically to display a popup. Here is the code in foo.rhtml: > <a href="javascript:popUp(''/summary.html'')" class="normal">Learn > more</a> > It doesn''t work. Any idea why?It should do. Does a non-javascript <a href=''/summary.html''>link</a> work? -- Alex
Alex Young wrote:> Lantis Sephiro wrote: >> How do i access a file in the public directory of rails application? I >> have several html files in there and i want to link them from the rhtml >> file. Basically to display a popup. Here is the code in foo.rhtml: >> <a href="javascript:popUp(''/summary.html'')" class="normal">Learn >> more</a> >> It doesn''t work. Any idea why? > It should do. Does a non-javascript <a href=''/summary.html''>link</a> > work?It does work in my local machine. It doesn''t work though when i put it on a web server. A normal link <a href=''/summary.html''> doesnt work either when i put it on the web server. -- Posted via http://www.ruby-forum.com/.
Lantis Sephiro wrote:> Alex Young wrote: > >>Lantis Sephiro wrote: >> >>>How do i access a file in the public directory of rails application? I >>>have several html files in there and i want to link them from the rhtml >>>file. Basically to display a popup. Here is the code in foo.rhtml: >>><a href="javascript:popUp(''/summary.html'')" class="normal">Learn >>>more</a> >>>It doesn''t work. Any idea why? >> >>It should do. Does a non-javascript <a href=''/summary.html''>link</a> >>work? > > > It does work in my local machine. It doesn''t work though when i put it > on a web server. A normal link <a href=''/summary.html''> doesnt work > either when i put it on the web server.Do the stylesheets work from the dynamic pages? If so, what do the stylesheet tags in the generated source look like? -- Alex
> Do the stylesheets work from the dynamic pages? If so, what do the > stylesheet tags in the generated source look like?The stylesheets work. This is the generated tag: <link href="/project/demo/myapp/stylesheets/style.css" media="all" rel="Stylesheet" type="text/css" /> -- Posted via http://www.ruby-forum.com/.
Lantis Sephiro wrote:>>Do the stylesheets work from the dynamic pages? If so, what do the >>stylesheet tags in the generated source look like? > > > The stylesheets work. This is the generated tag: > <link href="/project/demo/myapp/stylesheets/style.css" media="all" > rel="Stylesheet" type="text/css" /> >In that case, it looks like you''ll need to use: <a href=''/project/demo/myapp/summary.html''>link</a> Can''t think off the top of my head why you might need the extra routing information, though. -- Alex
Lantis Sephiro
2006-May-23 13:30 UTC
[Rails] Re: Re: Re: Accessing file in public directory
> In that case, it looks like you''ll need to use: > > <a href=''/project/demo/myapp/summary.html''>link</a> > > Can''t think off the top of my head why you might need the extra routing > information, though.Prefixing ''/project/demo/myapp/'' for each link does the trick. Like you, i still dont get why the extra routing is necessary. Is it because a symbolic link to hook up the application? THanks, Lantis. -- Posted via http://www.ruby-forum.com/.