What are the possibilities of file manipulation in RoR? How do you create a .html or .rhtml file with ruby to be placed in the public folder, with custom content? Btw, where is RoR root? Is that ''public''? -- Posted via http://www.ruby-forum.com/.
On Jul 12, 2006, at 14:49, P?l Bergstr?m wrote:> What are the possibilities of file manipulation in RoR? How do you > create a .html or .rhtml file with ruby to be placed in the public > folder, with custom content? > > Btw, where is RoR root? Is that ''public''?Yes, to get a normalized absolute path: File.expand_path(RAILS_ROOT) -- fxn
P?l Bergstr?m wrote:> What are the possibilities of file manipulation in RoR? How do you > create a .html or .rhtml file with ruby to be placed in the public > folder, with custom content?And what about file manipulation, creating a file (but maybe better in the views folder)? -- Posted via http://www.ruby-forum.com/.
P?l Bergstr?m wrote:> P?l Bergstr?m wrote: >> What are the possibilities of file manipulation in RoR? How do you >> create a .html or .rhtml file with ruby to be placed in the public >> folder, with custom content? > > And what about file manipulation, creating a file (but maybe better in > the views folder)?Think I understand it now. Found the answer in http://corelib.rubyonrails.org/ using File class. -- Posted via http://www.ruby-forum.com/.
P?l Bergstr?m wrote:> P?l Bergstr?m wrote: >> P?l Bergstr?m wrote: >>> What are the possibilities of file manipulation in RoR? How do you >>> create a .html or .rhtml file with ruby to be placed in the public >>> folder, with custom content? >> >> And what about file manipulation, creating a file (but maybe better in >> the views folder)? > > Think I understand it now. Found the answer in > http://corelib.rubyonrails.org/ using File class.Didn''t work. Could someone explain how you create a file? -- Posted via http://www.ruby-forum.com/.
P?l Bergstr?m wrote:> P?l Bergstr?m wrote: >> P?l Bergstr?m wrote: >>> P?l Bergstr?m wrote: >>>> What are the possibilities of file manipulation in RoR? How do you >>>> create a .html or .rhtml file with ruby to be placed in the public >>>> folder, with custom content? >>> >>> And what about file manipulation, creating a file (but maybe better in >>> the views folder)? >> >> Think I understand it now. Found the answer in >> http://corelib.rubyonrails.org/ using File class. > > Didn''t work. Could someone explain how you create a file?Now it did. Worked when I used "w" instead of "r" in File.new("name","w") -- Posted via http://www.ruby-forum.com/.