Frederick Cheung wrote: > On Jan 15, 6:15 am, Michael Linfield <[email protected]> wrote: >> >> def stuff >> send_file("#{RAILS_ROOT}/downloads/test.txt") >> end >> >> end >> >> #View# >> >> <% a = Misc.new %> >> <p><%= a.stuff %></p> > > This looks a little weird - from inside the view you're trying to > create a new instance of a controller ? This is probably failing > because you haven't initialized the controller properly. Why not call > send_file from the appropriate controller action ? > > Fred
o_O worked without a hitch... why would this be? As you suggested I threw it back in HomeController (via script/generate controller home index) under def index and walaa! But why can I not define a new class to separate objects in the same controller? Regards, - Mac -- Posted via http://www.ruby-forum.com/.
-- 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 [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

