Is it possible to run generator commands from within a running rails
application?

I'm experimenting with creating an application that can create 'views'
on the fly.

In my 'pages_controller.rb' I have the following code:

    # Run Ruby script to create all pages defined in
'website_pages.txt'
    load "/railsprojects/#{Website.find(@page.website_id).name}/public/
build_pages.rb"

In my 'build_pages.rb' I have the following code:

f = File.open("website_pages.txt", "r")
f.each_line do |page|
    ruby script/generate controller page
  end
file.close

The 'ruby script/generate controller page' command fails.  Does anyone
know how this line of code can be changed so that it will work?

Thanks,

Frank

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to