does anyone know how to use SSI on ruby on rails? I could not find an example anywhere. I just want to include and external file in a rhtml document but can''t seem to be able to find an example anywhere. -- Posted via http://www.ruby-forum.com/.
Hi Sam, On Sun, 2009-07-19 at 19:30 +0200, Sam Ginko wrote:> does anyone know how to use SSI on ruby on rails? > > I could not find an example anywhere. I just want to include and > external file in a rhtml document but can''t seem to be able to find an > example anywhere.If by SSI, you mean Server Side Includes, this is kind of an odd question given the nature of Ruby on Rails. If what you''re asking is specifically how to render an external file in a Rails view, in your model or controller, read the file into an instance variable and then use that instance variable in your view. HTH, Bill
Hi Bill, I''m trying to embed a google doc into a rhtml page. I do not want to use an iframe so I would like to do it with ruby. I''m not sure I understand why it is an odd question. PHP is using codeigniter as an MVC and you can still include files. Why is ruby on rails so different? And how would I be able to do the same thing? thanks bill walton wrote:> Hi Sam, > > On Sun, 2009-07-19 at 19:30 +0200, Sam Ginko wrote: >> does anyone know how to use SSI on ruby on rails? >> >> I could not find an example anywhere. I just want to include and >> external file in a rhtml document but can''t seem to be able to find an >> example anywhere. > > If by SSI, you mean Server Side Includes, this is kind of an odd > question given the nature of Ruby on Rails. > > If what you''re asking is specifically how to render an external file in > a Rails view, in your model or controller, read the file into an > instance variable and then use that instance variable in your view. > > HTH, > Bill-- Posted via http://www.ruby-forum.com/.
On Sun, 2009-07-19 at 20:15 +0200, Sam Ginko wrote:> Hi Bill, > > I''m trying to embed a google doc into a rhtml page. I do not > want to use an iframe so I would like to do it with ruby.When you say ''into an rhtml page'', it immediately implies to Rails developers that you''re talking about a Rails template that''s part of a Rails app. I have the feeling though, from what you''ve said now, that you have a static HTML page into which you want to include this google doc and you have it in mind to rename the file with an rhtml extension to tell Apache to parse it for SSI directives. Is that right?> I''m not sure I understand why it is an odd question.>From the "Apache Tutorial: Introduction to Server Side Includes"SSI (Server Side Includes) are directives that are placed in HTML pages, and evaluated on the server while the pages are being served. They let you add dynamically generated content to an existing HTML page, without having to serve the entire page via a CGI program, or other dynamic technology. The decision of when to use SSI, and when to have your page entirely generated by some program, is usually a matter of how much of the page is static, and how much needs to be recalculated every time the page is served. SSI is a great way to add small pieces of information, such as the current time. But if a majority of your page is being generated at the time that it is served, you need to look for some other solution. Rails programs are a means for generating pages on the server at the time a page is requested / served. Rails is one example of the ''some other solution'' the tutorial''s author speaks to in the last sentence above. You might be better off asking your question on the Ruby-talk mailing list. Best regards, Bill
You''re absolutely right. it is a rails template. I was trying to load an external document into that rhtml template from and external url. The easy way is to add an iframe and load the url in the src. I just wanted to avoid the iframe because of scrolling issues. regards sam bill walton wrote:> On Sun, 2009-07-19 at 20:15 +0200, Sam Ginko wrote: >> Hi Bill, >> >> I''m trying to embed a google doc into a rhtml page. I do not >> want to use an iframe so I would like to do it with ruby. > > When you say ''into an rhtml page'', it immediately implies to Rails > developers that you''re talking about a Rails template that''s part of a > Rails app. I have the feeling though, from what you''ve said now, that > you have a static HTML page into which you want to include this google > doc and you have it in mind to rename the file with an rhtml extension > to tell Apache to parse it for SSI directives. Is that right? > >> I''m not sure I understand why it is an odd question. > >>From the "Apache Tutorial: Introduction to Server Side Includes" > > SSI (Server Side Includes) are directives that are placed in > HTML pages, and evaluated on the server while the pages are > being served. They let you add dynamically generated content to > an existing HTML page, without having to serve the entire page > via a CGI program, or other dynamic technology. > > The decision of when to use SSI, and when to have your page > entirely generated by some program, is usually a matter of how > much of the page is static, and how much needs to be > recalculated every time the page is served. SSI is a great way > to add small pieces of information, such as the current time. > But if a majority of your page is being generated at the time > that it is served, you need to look for some other solution. > > Rails programs are a means for generating pages on the server at the > time a page is requested / served. Rails is one example of the ''some > other solution'' the tutorial''s author speaks to in the last sentence > above. > > You might be better off asking your question on the Ruby-talk mailing > list. > > Best regards, > Bill-- Posted via http://www.ruby-forum.com/.