Can I call partials from html files in public? Is this wise? I''ve got a bunch of html files and I''d like to let them have access to pieces of Rails, but I''d like to manage them through Contribute or some such. I *could* wiki them up, but that seems like a lot of work for pages that don''t get updated that often (yearly or so). Thanks in advance! - Dave -- David Humphreys dave@dbhumphreys.com
Can I call partials from html files in public? Is this wise? I''ve got a bunch of html files and I''d like to let them have access to pieces of Rails, but I''d like to manage them through Contribute or some such. I could wiki them up, but that seems like a lot of work for pages that don''t get updated that often (yearly or so). Thanks in advance! - Dave -- David Humphreys dave@dbhumphreys.com
On 3/9/06, David Humphreys <dbhumphreys@gmail.com> wrote:> > Can I call partials from html files in public? > > Is this wise?You probably could, but it wouldn''t be easy. I don''t know how many files you''d have to change, but I can''t imagine it being worth the effort. -- Joshua -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060309/b17b01da/attachment.html
>> Can I call partials from html files in public?> You probably could, but it wouldn''t be easy. > > I don''t know how many files you''d have to changeit''s easy, and none. see public/index.html in a fresh 1.1/trunk install.. it already dynamically updates part of the page.. -- Posted via http://www.ruby-forum.com/.
It actually wouldnt be that hard. Not sure the correct syntax, but something like: def render_something(something) IO.read("#{RAILS_ROOT}/public/#{somthing}") end (again syntax may be off, but the idea is the same) This simply reads the HTML file (or whatever something is) and returns it. Put this in application.rb and you can now render anything in your public folder. -Nick On 3/9/06, Josh on Rails <rails@thewehners.net> wrote:> > On 3/9/06, David Humphreys <dbhumphreys@gmail.com> wrote: > > > > Can I call partials from html files in public? > > > > Is this wise? > > > You probably could, but it wouldn''t be easy. > > I don''t know how many files you''d have to change, but I can''t imagine it > being worth the effort. > > > > -- Joshua > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060309/c271304b/attachment.html