Dear All: I am using ruby for automation test scripts. Now I want to integrate Ruby code with HTML. How can I achieve this? Thanks in advance. -- Thanks and Regards, Amit -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
What do you mean integrate ruby code with html? just print the html markup if you want to output html. like this , puts ''<div>hello ruby,</div>'' it will outputs as a string when you in terminal, except you work on browser that renders the string to html automatically. 2011/7/6 Amit Bobade <amit.srpce-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>> Dear All: > > I am using ruby for automation test scripts. Now I want to integrate Ruby > code with HTML. How can I achieve this? > Thanks in advance. > > -- > Thanks and Regards, > Amit > > -- > 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. >-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Gustavo de Sá Carvalho Honorato
2011-Jul-06 11:13 UTC
Re: How to integrate Ruby code with HTML?
You can use ERB. Take a look: http://ruby-doc.org/stdlib/libdoc/erb/rdoc/classes/ERB.html On Wed, Jul 6, 2011 at 6:10 AM, coolesting <coolesting-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> What do you mean integrate ruby code with html? > just print the html markup if you want to output html. > like this , > > puts ''<div>hello ruby,</div>'' > > it will outputs as a string when you in terminal, except you work on > browser that renders the string to html automatically. > > 2011/7/6 Amit Bobade <amit.srpce-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > >> Dear All: >> >> I am using ruby for automation test scripts. Now I want to integrate Ruby >> code with HTML. How can I achieve this? >> Thanks in advance. >> >> -- >> Thanks and Regards, >> Amit >> >> -- >> 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >> To unsubscribe from this group, send email to >> rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >> For more options, visit this group at >> http://groups.google.com/group/rubyonrails-talk?hl=en. >> > > -- > 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. >-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Hi, I meant can I call the Ruby script from the HTML code just like Javascript? I want to call ruby script by clicking the button. Is it possible? Thanks On Wed, Jul 6, 2011 at 2:40 PM, coolesting <coolesting-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> What do you mean integrate ruby code with html? > just print the html markup if you want to output html. > like this , > > puts ''<div>hello ruby,</div>'' > > it will outputs as a string when you in terminal, except you work on > browser that renders the string to html automatically. > > 2011/7/6 Amit Bobade <amit.srpce-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > >> Dear All: >> >> I am using ruby for automation test scripts. Now I want to integrate Ruby >> code with HTML. How can I achieve this? >> Thanks in advance. >> >> -- >> Thanks and Regards, >> Amit >> >> -- >> 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >> To unsubscribe from this group, send email to >> rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >> For more options, visit this group at >> http://groups.google.com/group/rubyonrails-talk?hl=en. >> > > -- > 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. >-- Thanks and Regards, Amit -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Wed, Jul 6, 2011 at 8:46 PM, Amit Bobade <amit.srpce-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi, > > I meant can I call the Ruby script from the HTML code just like Javascript? > I want to call ruby script by clicking the button. Is it possible? > >You can''t run a ruby script on the client side. You need to use ajax to contact the server and then run the script and then return a response to the client side.> Thanks > > > On Wed, Jul 6, 2011 at 2:40 PM, coolesting <coolesting-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > >> What do you mean integrate ruby code with html? >> just print the html markup if you want to output html. >> like this , >> >> puts ''<div>hello ruby,</div>'' >> >> it will outputs as a string when you in terminal, except you work on >> browser that renders the string to html automatically. >> >> 2011/7/6 Amit Bobade <amit.srpce-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> >> >>> Dear All: >>> >>> I am using ruby for automation test scripts. Now I want to integrate Ruby >>> code with HTML. How can I achieve this? >>> Thanks in advance. >>> >>> -- >>> Thanks and Regards, >>> Amit >>> >>> -- >>> 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >>> To unsubscribe from this group, send email to >>> rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >>> For more options, visit this group at >>> http://groups.google.com/group/rubyonrails-talk?hl=en. >>> >> >> -- >> 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >> To unsubscribe from this group, send email to >> rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >> For more options, visit this group at >> http://groups.google.com/group/rubyonrails-talk?hl=en. >> > > > > -- > Thanks and Regards, > Amit > > -- > 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. >-- ------------------------------------------------------------- visit my blog at http://jimlabs.heroku.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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.