Issue 1: <%= @pic %> instead of <% @pic %> -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED] Sent: Wednesday, May 17, 2006 11:13 PM To: rails-spinoffs@lists.rubyonrails.org Subject: Rails-spinoffs Digest, Vol 12, Issue 29
Send Rails-spinoffs mailing list submissions to rails-spinoffs@lists.rubyonrails.org To subscribe or unsubscribe via the World Wide Web, visit http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs or, via email, send a message with subject or body 'help' to [EMAIL PROTECTED] You can reach the person managing the list at [EMAIL PROTECTED] When replying, please edit your Subject line so it is more specific than "Re: Contents of Rails-spinoffs digest..." Today's Topics: 1. Display Images from URL in Database (Ben Lisbakken) 2. How to send data using prototype (Fernando) 3. RE: How to send data using prototype (Martinez, Andrew) 4. Autocomplete GetToken?? (Daniel Elmore) 5. Re: Autocomplete GetToken?? (Andrew Tetlaw) 6. RE: Autocomplete GetToken?? (Daniel Elmore) 7. Re: Display Images from URL in Database (Rongzhong Lu) 8. Re: Prototype & Scriptaculous vs. Yahoo UI Library (Peter Michaux) 9. Re: Prototype & Scriptaculous vs. Yahoo UI Library (Andrew Tetlaw) ---------------------------------------------------------------------- Message: 1 Date: Wed, 17 May 2006 13:43:33 -0700 From: Ben Lisbakken <[EMAIL PROTECTED]> Subject: [Rails-spinoffs] Display Images from URL in Database To: rails-spinoffs@lists.rubyonrails.org Message-ID: <[EMAIL PROTECTED]> Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed I am only 3 days into rails, so please excuse the stupid question. I am trying to access my database named Movies. I am using a table named movie. I would like to pull the table entry with field vname=rawr, and then take this entry's field vpic, and use that vpic (assume its a url to an image) to display an image. To begin with, I am having problems with displaying an image with html + ruby. In my index.rhtml I have two lines: <% @pic = 'http://www.showfly.net/img/1.jpg' %> <img src='<% @pic %>' width="50" height="75"></img> And it doesn't display the image. What did I do wrong? How do I make the @pic be the url that i did a search for in my database? Thank you, Ben ------------------------------ Message: 2 Date: Wed, 17 May 2006 17:56:10 -0300 From: Fernando <[EMAIL PROTECTED]> Subject: [Rails-spinoffs] How to send data using prototype To: rails-spinoffs@lists.rubyonrails.org Message-ID: <[EMAIL PROTECTED]> Content-Type: text/plain; charset=ISO-8859-1; format=flowed I have a form, with a input type="file", how to send this "file" to the POST var? ------------------------------ Message: 3 Date: Wed, 17 May 2006 17:32:21 -0400 From: "Martinez, Andrew" <[EMAIL PROTECTED]> Subject: RE: [Rails-spinoffs] How to send data using prototype To: <rails-spinoffs@lists.rubyonrails.org> Message-ID: <[EMAIL PROTECTED]> Content-Type: text/plain; charset="iso-8859-1" Not really our realm but if you just enclose the input element within <form> tags and specify the action and provide a way to submit the form, it will be sent along with the regular POST data. -Andrew Martinez -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Fernando Sent: Wednesday, May 17, 2006 4:56 PM To: rails-spinoffs@lists.rubyonrails.org Subject: [Rails-spinoffs] How to send data using prototype I have a form, with a input type="file", how to send this "file" to the POST var? _______________________________________________ Rails-spinoffs mailing list Rails-spinoffs@lists.rubyonrails.org http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs ------------------------------ Message: 4 Date: Wed, 17 May 2006 17:31:27 -0500 From: "Daniel Elmore" <[EMAIL PROTECTED]> Subject: [Rails-spinoffs] Autocomplete GetToken?? To: <rails-spinoffs@lists.rubyonrails.org> Message-ID: <[EMAIL PROTECTED]> Content-Type: text/plain; charset="us-ascii" Hi, I needing to modify the control.js file and am confused about what the purpose of the getToken function is. I read the docs section below and still don't understand why it doesn't just access the form.value directly. Docs say: This method should get the text for which to provide autocompletion by invoking this.getToken(), NOT by directly accessing this.element.value. This is to allow incremental tokenized autocompletion. Does anyone understand the getToken function?? Thanks! ------------------------------ Message: 5 Date: Thu, 18 May 2006 08:46:49 +1000 From: "Andrew Tetlaw" <[EMAIL PROTECTED]> Subject: Re: [Rails-spinoffs] Autocomplete GetToken?? To: rails-spinoffs@lists.rubyonrails.org Message-ID: <[EMAIL PROTECTED]> Content-Type: text/plain; charset=UTF-8; format=flowed AFAIK it's because some autocompletion fields might take multiple values and be delimited by characters like a comma or space. The get token method allows you to get the last keyword/tag the user is entering and instead of the whole value. On 18/05/06, Daniel Elmore <[EMAIL PROTECTED]> wrote: > Hi, I needing to modify the control.js file and am confused about what the > purpose of the getToken function is. I read the docs section below and still > don't understand why it doesn't just access the form.value directly. > > Docs say: > This method should get the text for which to provide autocompletion by > invoking this.getToken(), NOT by directly accessing this.element.value. This > is to allow incremental tokenized autocompletion. > > Does anyone understand the getToken function?? > > Thanks! > > _______________________________________________ > Rails-spinoffs mailing list > Rails-spinoffs@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs > -- Andrew ------------------------------ Message: 6 Date: Wed, 17 May 2006 18:29:07 -0500 From: "Daniel Elmore" <[EMAIL PROTECTED]> Subject: RE: [Rails-spinoffs] Autocomplete GetToken?? To: <rails-spinoffs@lists.rubyonrails.org> Message-ID: <[EMAIL PROTECTED]> Content-Type: text/plain; charset="us-ascii" Ah, I see. Looking at the code, what you said makes since. I guess that would be for typing in "tags" or something like that. Thanks -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Andrew Tetlaw Sent: Wednesday, May 17, 2006 5:47 PM To: rails-spinoffs@lists.rubyonrails.org Subject: Re: [Rails-spinoffs] Autocomplete GetToken?? AFAIK it's because some autocompletion fields might take multiple values and be delimited by characters like a comma or space. The get token method allows you to get the last keyword/tag the user is entering and instead of the whole value. On 18/05/06, Daniel Elmore <[EMAIL PROTECTED]> wrote: > Hi, I needing to modify the control.js file and am confused about what the > purpose of the getToken function is. I read the docs section below and still > don't understand why it doesn't just access the form.value directly. > > Docs say: > This method should get the text for which to provide autocompletion by > invoking this.getToken(), NOT by directly accessing this.element.value. This > is to allow incremental tokenized autocompletion. > > Does anyone understand the getToken function?? > > Thanks! > > _______________________________________________ > Rails-spinoffs mailing list > Rails-spinoffs@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs > -- Andrew ------------------------------ Message: 7 Date: Thu, 18 May 2006 08:50:55 +0800 From: "Rongzhong Lu" <[EMAIL PROTECTED]> Subject: Re: [Rails-spinoffs] Display Images from URL in Database To: rails-spinoffs@lists.rubyonrails.org Message-ID: <[EMAIL PROTECTED]> Content-Type: text/plain; charset="iso-8859-1" I think your <img src='<% @pic %>' width="50" height="75"></img> is wrong you can writen it like this : <img src='<%= @pic %>' width="50" height="75"></img> <%=%> evaluate the ruby expression., this can return result of the expression. <%%> ddeclare ruby expression or statement. 2006/5/18, Ben Lisbakken <[EMAIL PROTECTED]>: > > I am only 3 days into rails, so please excuse the stupid question. > > I am trying to access my database named Movies. I am using a table > named movie. I would like to pull the table entry with field > vname=rawr, and then take this entry's field vpic, and use that vpic > (assume its a url to an image) to display an image. > > To begin with, I am having problems with displaying an image with > html + ruby. In my index.rhtml I have two lines: > <% @pic = 'http://www.showfly.net/img/1.jpg' %> > <img src='<% @pic %>' width="50" height="75"></img> > > And it doesn't display the image. What did I do wrong? How do I > make the @pic be the url that i did a search for in my database? > > Thank you, > Ben > _______________________________________________ > Rails-spinoffs mailing list > Rails-spinoffs@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails-spinoffs/attachments/20060518/3 76f90de/attachment-0001.html ------------------------------ Message: 8 Date: Wed, 17 May 2006 21:58:57 -0700 From: "Peter Michaux" <[EMAIL PROTECTED]> Subject: Re: [Rails-spinoffs] Prototype & Scriptaculous vs. Yahoo UI Library To: rails-spinoffs@lists.rubyonrails.org Message-ID: <[EMAIL PROTECTED]> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Andrzej, I have been using the Yahoo! UI connection and drag and drop libraries a bit instead of Prototype.js Partly this is because I had read so many warning about the quality of the Prototype.js library. Partly because I don't like the enumerable stuff in Prototype.js. I think it makes for ugly JavaScript. Partly because I don't really like seeing JavaScript hidden under Ruby wrappers in my code. Yes JavaScript is weird but if I want to use JavaScript to do a job then I don't mind coding in JavaScript. The newest version of Prototype.js has nice Ajax stuff but I haven't found a way to do what the Yahoo! UI connection "argument" can do. See the Yahoo! UI docs. The Yahoo! UI library has a rediculous requirement that every dragdrop element must have an id. I have to invent dummy ids for sortable list elements. I hope this goes away. The sortable list options in both libraries are not so great. However with the power of the new rjs templates I am using Prototype.js a little bit. Prototype.js is so integrated into the rails way of doing things it might not be good to avoid it all together. With rjs it feels like fighting to avoid Prototype.js. The way my app is set up it is not a problem for the client to download both some Yahoo and Prototype libraries. I might just happily sit on the fence. Peter On 5/17/06, Andrzej Rumpfelt <[EMAIL PROTECTED]> wrote: > > > I know there was a discussion about it while ago but I just checked some of > the Yahoo's libs and design patterns and just wondering what are the > advantages of using one instead of another ? > I only saw yahoo's examples - didn't get down to the code.. Have you tried > to play with it ? How is it comparing to prototype style ? > > I would like to know what do you think about it :) > > greetings, > Andrzej > _______________________________________________ > Rails-spinoffs mailing list > Rails-spinoffs@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs > > > ------------------------------ Message: 9 Date: Thu, 18 May 2006 15:13:18 +1000 From: "Andrew Tetlaw" <[EMAIL PROTECTED]> Subject: Re: [Rails-spinoffs] Prototype & Scriptaculous vs. Yahoo UI Library To: rails-spinoffs@lists.rubyonrails.org Message-ID: <[EMAIL PROTECTED]> Content-Type: text/plain; charset=UTF-8; format=flowed I don't even know Ruby but I love the Enumeration helpers. For example, $A().without() is something you do often in javascript and I'm happy not to have to write a for-next loop and test values everytime I need to do it. On 18/05/06, Peter Michaux <[EMAIL PROTECTED]> wrote: > Andrzej, > > I have been using the Yahoo! UI connection and drag and drop libraries > a bit instead of Prototype.js > > Partly this is because I had read so many warning about the quality of > the Prototype.js library. Partly because I don't like the enumerable > stuff in Prototype.js. I think it makes for ugly JavaScript. Partly > because I don't really like seeing JavaScript hidden under Ruby > wrappers in my code. Yes JavaScript is weird but if I want to use > JavaScript to do a job then I don't mind coding in JavaScript. > > The newest version of Prototype.js has nice Ajax stuff but I haven't > found a way to do what the Yahoo! UI connection "argument" can do. See > the Yahoo! UI docs. > > The Yahoo! UI library has a rediculous requirement that every dragdrop > element must have an id. I have to invent dummy ids for sortable list > elements. I hope this goes away. The sortable list options in both > libraries are not so great. > > However with the power of the new rjs templates I am using > Prototype.js a little bit. Prototype.js is so integrated into the > rails way of doing things it might not be good to avoid it all > together. With rjs it feels like fighting to avoid Prototype.js. > > The way my app is set up it is not a problem for the client to > download both some Yahoo and Prototype libraries. I might just happily > sit on the fence. > > Peter > > > On 5/17/06, Andrzej Rumpfelt <[EMAIL PROTECTED]> wrote: > > > > > > I know there was a discussion about it while ago but I just checked some of > > the Yahoo's libs and design patterns and just wondering what are the > > advantages of using one instead of another ? > > I only saw yahoo's examples - didn't get down to the code.. Have you tried > > to play with it ? How is it comparing to prototype style ? > > > > I would like to know what do you think about it :) > > > > greetings, > > Andrzej > > _______________________________________________ > > Rails-spinoffs mailing list > > Rails-spinoffs@lists.rubyonrails.org > > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs > > > > > > > _______________________________________________ > Rails-spinoffs mailing list > Rails-spinoffs@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs > -- Andrew ------------------------------ _______________________________________________ Rails-spinoffs mailing list Rails-spinoffs@lists.rubyonrails.org http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs End of Rails-spinoffs Digest, Vol 12, Issue 29 ********************************************** _______________________________________________ Rails-spinoffs mailing list Rails-spinoffs@lists.rubyonrails.org http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs