|
|
|
|
||||||
![]() |
|
|
LinkBack | Outils de la discussion |
|
|
#1 |
|
Messages: n/a
Hébergeur: |
Hi all,
I'm trying to do a quick dump of a javascript and style sheet located in their respective /public directories into an rhtml file. I want to include the entire text of the file in my rhtml file. How do I do this quickly and efficiently? In PHP there's readfile, but I can't figure out an equivalent call in ruby. Thanks so much in advance! Tim -- Posted via http://www.ruby-forum.com/. |
|
|
|
#2 |
|
Messages: n/a
Hébergeur: |
Tim Trampedach wrote in message ne\
> I'm trying to do a quick dump of a javascript and style sheet located in > their respective /public directories into an rhtml file. <%=h File.read(RAILS_ROOT + '/public/javascript/my_source.js') %> This is half introductory Ruby and half introductory Rails, so one might consider reading a little of the excellent books on these subjects, offline, for a while! -- Phlip |
|
|
|
#3 |
|
Messages: n/a
Hébergeur: |
Phlip wrote:
> Tim Trampedach wrote in message ne\ > >> I'm trying to do a quick dump of a javascript and style sheet located in >> their respective /public directories into an rhtml file. > > <%=h File.read(RAILS_ROOT + '/public/javascript/my_source.js') %> > > This is half introductory Ruby and half introductory Rails, so one might > consider reading a little of the excellent books on these subjects, > offline, for a while! Rails questions are better directed to Rails mailing list, where you'll get better, faster, information. -- James Britt "Judge a man by his questions, rather than his answers." - Voltaire |
|
|
|
#4 |
|
Messages: n/a
Hébergeur: |
On Sat, Sep 15, 2007 at 02:24:59PM +0900, James Britt wrote:
> Phlip wrote: >> Tim Trampedach wrote in message ne\ >>> I'm trying to do a quick dump of a javascript and style sheet located in >>> their respective /public directories into an rhtml file. >> <%=h File.read(RAILS_ROOT + '/public/javascript/my_source.js') %> >> This is half introductory Ruby and half introductory Rails, so one might >> consider reading a little of the excellent books on these subjects, >> offline, for a while! > > Rails questions are better directed to Rails mailing list, where you'll get > better, faster, information. While Philip may have assumed that Tim was using Rails, there was nothing in the original post to indicate that Rails is involved. It's just ERB to produce HTML (in this case with embedded JS and CSS), which comes up in other contexts. > James Britt --Greg |
|
|
|
#5 |
|
Messages: n/a
Hébergeur: |
Gregory Seidman wrote:
> > While Philip may have assumed that Tim was using Rails, there was nothing > in the original post to indicate that Rails is involved. It's just ERB to > produce HTML (in this case with embedded JS and CSS), which comes up in > other contexts. Amazingly true. My reply was to suggest a better place for Rails if this was in fact part of a Rails matter. -- James Britt "I have the uncomfortable feeling that others are making a religion out of it, as if the conceptual problems of programming could be solved by a single trick, by a simple form of coding discipline!" - Edsger Dijkstra |
|
![]() |
| Outils de la discussion | |
|
|