Hi, I am having trouble figuring out how to do this... I am developing a new ruby on rails project and I am trying figure out how to write code so that when a user inputs their info into a form and they click on submit (or in my case, "get code") the code generated will show in the browser so that they can copy and paste that code into their own html doc. is there a way to do this with ruby? If so, I would greatly appreciate any help on this :) thanks in advance! Jeremy -- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On Thu, May 8, 2008 at 11:00 AM, Jeremy Jeremy <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> I am developing a new ruby on rails project and > I am trying figure out how to write code so that when a user inputs > their info into a form and they click on submit (or in my case, "get > code") > the code generated will show in the browser so that they can copy and > paste that code into their own html doc.Whatever you put in the view will be shown in the browser. Perhaps you can clarify how your situation is different than normal? -- Hassan Schroeder ------------------------ hassan.schroeder-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org --~--~---------~--~----~------------~-------~--~----~ 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-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Hassan Schroeder wrote:> On Thu, May 8, 2008 at 11:00 AM, Jeremy Jeremy > <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote: > >> I am developing a new ruby on rails project and >> I am trying figure out how to write code so that when a user inputs >> their info into a form and they click on submit (or in my case, "get >> code") >> the code generated will show in the browser so that they can copy and >> paste that code into their own html doc. > > Whatever you put in the view will be shown in the browser. Perhaps > you can clarify how your situation is different than normal? > > -- > Hassan Schroeder ------------------------ hassan.schroeder-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.orgHi there, I apologize. What i mean is.. you have a basic page with a form on it. the user inputs the info into the form. Then when they click on the submit button.. it produces the information into code viewable for the user to see. an example is if i had a page where a user could enter a size, width and upload a picture into the form that is available on that page.. then they hit the submit button. it would generate the code in the browser to tell the user what code they would need to put it on their own html doc. much like this code... so they enter their information into the form.. they hit the submit button and this is what is produced on their browser window. <a href="rubyForum"><img src="http://www.rubyforum.com" /></a> I hope that clears things a little :) Thanks for your help. -- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On Thu, May 8, 2008 at 11:12 AM, Jeremy B. <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> an example is if i had a page where a user could enter a size, width and > upload a picture into the form that is available on that page.. then > they hit the submit button. it would generate the code in the browser to > tell the user what code they would need to put it on their own html doc. > much like this code...So you''re not talking about code, you''re talking about markup. There /is/ a difference :-)> ... and this is what is produced on their browser window. > <a href="rubyForum"><img src="http://www.rubyforum.com" /></a>require ''cgi'' example = ''<a href="rubyForum"><img src="http://www.rubyforum.com" /></a>'' CGI.escapeHTML(example) is probably what you''re looking for. There are probably alternatives, but I''m new to RoR too :-) HTH, -- Hassan Schroeder ------------------------ hassan.schroeder-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org --~--~---------~--~----~------------~-------~--~----~ 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-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
i want it to act ALOT like this form at the bottom of the page http://www.mozilla.org/docs/web-developer/css1technote/css1tojs.html -- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
> So you''re not talking about code, you''re talking about markup. > There /is/ a difference :-) > >> ... and this is what is produced on their browser window. >> <a href="rubyForum"><img src="http://www.rubyforum.com" /></a> > > require ''cgi'' > example = ''<a href="rubyForum"><img src="http://www.rubyforum.com" > /></a>'' > CGI.escapeHTML(example) > > is probably what you''re looking for. There are probably alternatives, > but > I''m new to RoR too :-) > > HTH, > -- > Hassan Schroeder ------------------------ hassan.schroeder-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.orgOh yeah, duh...lol i guess i should have said markup.. sorry bout that Okay I will try that :) thanks very much for your help! -- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---