tklumker@tmo.blackberry.net
2006-Jun-09 23:36 UTC
[Rails] Re: Rails Digest, Vol 21, Issue 195
Unsubscribe Sent from my BlackBerry? wireless handheld -----Original Message----- From: rails-request@lists.rubyonrails.org Date: Fri, 9 Jun 2006 18:24:09 To:rails@lists.rubyonrails.org Subject: Rails Digest, Vol 21, Issue 195 Send Rails mailing list submissions to rails@lists.rubyonrails.org To subscribe or unsubscribe via the World Wide Web, visit http://lists.rubyonrails.org/mailman/listinfo/rails or, via email, send a message with subject or body ''help'' to rails-request@lists.rubyonrails.org You can reach the person managing the list at rails-owner@lists.rubyonrails.org When replying, please edit your Subject line so it is more specific than "Re: Contents of Rails digest..." Today''s Topics: 1. Re: Securing database from your provider? (Julian ''Julik'' Tarkhanov) 2. Re: Connecting to SQL Server 2000 database - errors (Roland Mai) 3. Re: Is IRB the ruby console ? (Curtis) 4. Re: using a variable as substitute for a method (Roland Mai) 5. Re: using a variable as substitute for a method (Alder Green) 6. Noob with Overwhelming Deployment Woes... (Jason Pfeifer) 7. Re: email when validation fails (Roland Mai) 8. blank division after update (Dorian) 9. Re: Noob with Overwhelming Deployment Woes... (Curtis) 10. Re: using a variable as substitute for a method (zero halo) 11. Re: blank division after update (Charlie Bowman) 12. Re: blank division after update (Dorian) 13. Re: Connecting to SQL Server 2000 database - errors (Harry) ---------------------------------------------------------------------- Message: 1 Date: Fri, 9 Jun 2006 19:56:56 +0200 From: Julian ''Julik'' Tarkhanov <listbox@julik.nl> Subject: Re: [Rails] Securing database from your provider? To: rails@lists.rubyonrails.org Message-ID: <6914D1EF-5012-47A8-A465-AE86DBB85308@julik.nl> Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed On 9-jun-2006, at 18:45, Tom Mornini wrote:> > The biggest disadvantage (though pretty much a requirement if > serious security is your concern) is that the application cannot > auto-start.Or just run all the database on your server and connect to it from the application via an SSL socket... but the question actually is absurd. There is (currently) no way to obfuscate/encrypt Ruby code, so if someone can see your code he will be able to get access to your database. "Get your own server" is the answer here. -- Julian ''Julik'' Tarkhanov please send all personal mail to me at julik.nl ------------------------------ Message: 2 Date: Fri, 9 Jun 2006 19:57:35 +0200 From: Roland Mai <roland.mai@gmail.com> Subject: [Rails] Re: Connecting to SQL Server 2000 database - errors To: rails@lists.rubyonrails.org Message-ID: <33d777a12aa29a59ef21cee37983bb77@ruby-forum.com> Content-Type: text/plain; charset=utf-8 Hello Harry, I posted some notes I took when I set up the MSDE 2000 on my blog: http://www.llafe.com/articles/2006/05/29/sql-server-msde-install-instructions I hope you find the right configuration there. The most common error is related to the database.yml. In it change the host from localhost to (local). Roland -- Posted via http://www.ruby-forum.com/. ------------------------------ Message: 3 Date: Fri, 9 Jun 2006 11:59:34 -0600 From: Curtis <cuspendlove@gmail.com> Subject: Re: [Rails] Is IRB the ruby console ? To: rails@lists.rubyonrails.org Message-ID: <b0967e0f0606091059j65986e1n28e5feecc39a35fb@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed On 6/9/06, Dark Ambient <sambient@gmail.com> wrote:> Just as I was about to add ruby/bin to the environment variables your email > came through. Yes, I opened the console window from Instantrails and while > it looked like a regular cmd window , the command script/console worked. > My apologies, I''ve been doing most of the work in radrails and completely > forgot about the console option. > Thanks to all for the help and my apologies for being totally stupid about > this.Heehee... None of us (except maybe the core team) knew all of this stuff when they were born.... No worries. :) -Curtis ------------------------------ Message: 4 Date: Fri, 9 Jun 2006 20:00:05 +0200 From: Roland Mai <roland.mai@gmail.com> Subject: [Rails] Re: using a variable as substitute for a method To: rails@lists.rubyonrails.org Message-ID: <1fca7e70d7dbd4c8f48aeb03fee3b8a1@ruby-forum.com> Content-Type: text/plain; charset=utf-8 I think that Product["#{params[:foo]}"] should do the work. Roland -- Posted via http://www.ruby-forum.com/. ------------------------------ Message: 5 Date: Fri, 9 Jun 2006 21:02:51 +0300 From: "Alder Green" <alder.green@gmail.com> Subject: Re: [Rails] using a variable as substitute for a method To: rails@lists.rubyonrails.org Message-ID: <68816b4c0606091102y5bd2ec37ya5c1fb690f31f248@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed On 6/9/06, zero halo <zerohalo@gmail.com> wrote:> That probably isn''t the right title for this topic, but I''m not sure how > else to explain in succintly. I''m sorry if this is obvious but I > couldn''t find the answer in the Ruby/Rails docs. > > How do I use a variable as a substitute for a method/field, so that I > can call the object with the variable that contains the method name.Generally it''s done by obj.send(var) Method calls are just messages send to objects, so you can use the #send method to do that. In ActiveRecords''s case, there''s a special convenience method that should work: ar_instance[var]> > For example, say I have the object Product, that has methods Price, > Last_Price, Average_Price. > > I want to be able to return the value of either of those three fields > based on the user selection. Ie, user selection is stored in > params[:foo], which I assign to variable field_to_show, and I want to be > able to call: > > Product.field_to_show > > which should output Product.Price (if params[:foo] contained ''Price'') > > Currently this gives a no method error. > > I know that I can do > case params[:foo] > when "Price" > Product.Price > etc > > but it seems to me that there should be a way of avoiding that extra > code. > > I also tried: > > Product.#{field_to_show} > > and it didn''t work (no method error) > > Thansk for the help. > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-- -Alder ------------------------------ Message: 6 Date: Fri, 9 Jun 2006 20:03:56 +0200 From: Jason Pfeifer <jpfeifer@shaw.ca> Subject: [Rails] Noob with Overwhelming Deployment Woes... To: rails@lists.rubyonrails.org Message-ID: <ed523c9ac3ebbc029342aa3994e42946@ruby-forum.com> Content-Type: text/plain; charset=utf-8 I''m doing some searching for deployment options, and I feel like I''m getting buried in a lot of new technology and assumptions that I know all that it''s dependent on. In the past I''ve done small things with PHP where I just dump the app in a folder and everything works out of the box. I found that everyone is using Capistrano, which relies on Subversion repositories - which I know of but don''t know how to setup or use. Then there is also lighttpd, fcgi, apache, and a host of other pseudonyms to worry about configuring. Can anyone reccomend where to get started at the beginning of all this? I''d like to deploy to my shared textdrive account for starters if that helps at all. I appreciate the help. Jason -- Posted via http://www.ruby-forum.com/. ------------------------------ Message: 7 Date: Fri, 9 Jun 2006 20:04:49 +0200 From: Roland Mai <roland.mai@gmail.com> Subject: [Rails] Re: email when validation fails To: rails@lists.rubyonrails.org Message-ID: <408ee5cf016ba44c71dc91c9007abdd9@ruby-forum.com> Content-Type: text/plain; charset=utf-8 I think the valid? function is your answer. http://api.rubyonrails.com/classes/ActiveRecord/Validations.html#M000801 Roland -- Posted via http://www.ruby-forum.com/. ------------------------------ Message: 8 Date: Fri, 9 Jun 2006 20:09:20 +0200 From: Dorian <bigdorian@otherag.com> Subject: [Rails] blank division after update To: rails@lists.rubyonrails.org Message-ID: <c4352f9f5d00785e8352384fd45f4826@ruby-forum.com> Content-Type: text/plain; charset=utf-8 Hello all, Im having a slight problem with my website. I have a division that is updated using a link_to_remote call. Now, inside the view I can put plain text and everything is fine. However, if I try to pass a variable from the controller to the view it does not work. For example I can have this as the controller: def show_news @testvariable = "shizzlenitboo" end And inside the view I can put <%= @shizzlenitboo %> Yet nothing will display. Does anyone know what is causing this? -- Posted via http://www.ruby-forum.com/. ------------------------------ Message: 9 Date: Fri, 9 Jun 2006 12:12:17 -0600 From: Curtis <cuspendlove@gmail.com> Subject: Re: [Rails] Noob with Overwhelming Deployment Woes... To: rails@lists.rubyonrails.org Message-ID: <b0967e0f0606091112i16a56d22l66c315c8c1c7ce6a@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed On 6/9/06, Jason Pfeifer <jpfeifer@shaw.ca> wrote:> I''m doing some searching for deployment options, and I feel like I''m > getting buried in a lot of new technology and assumptions that I know > all that it''s dependent on. In the past I''ve done small things with PHP > where I just dump the app in a folder and everything works out of the > box.You can technically copy a Rails app to a directory and it will run out of the box as long as the requirements on the "server" are met (no different than PHP or any other language). In fact I find it easier to setup a RoR environment on a new computer than a PHP one, but that''s a digression.> I found that everyone is using Capistrano, which relies on Subversion > repositories - which I know of but don''t know how to setup or use. Then > there is also lighttpd, fcgi, apache, and a host of other pseudonyms to > worry about configuring.It can be, you can get a lot of information about these things at the Rails Document site, and particularly the Wiki. However...since you''re using TextDrive...> Can anyone reccomend where to get started at the beginning of all this? > I''d like to deploy to my shared textdrive account for starters if that > helps at all.The TextDrive forums have a lot of good information about deploying a Rails app on the server. You also have Subversion access from the server at TextDrive, there are documents in the forums stating how to get that up and running. Capistrano is available through them as well. It should probably take less than a day even though it does seem a little daunting at first... -Curtis ------------------------------ Message: 10 Date: Fri, 9 Jun 2006 20:12:52 +0200 From: zero halo <zerohalo@gmail.com> Subject: [Rails] Re: using a variable as substitute for a method To: rails@lists.rubyonrails.org Message-ID: <b39eb828095c5709b524cbedd14d0b23@ruby-forum.com> Content-Type: text/plain; charset=utf-8 Alder Green wrote:> Generally it''s done by > > obj.send(var) > > Method calls are just messages send to objects, so you can use the > #send method to do that. > > In ActiveRecords''s case, there''s a special convenience method that > should work: > > ar_instance[var]Both of those worked. Thanks, Alder. -- Posted via http://www.ruby-forum.com/. ------------------------------ Message: 11 Date: Fri, 09 Jun 2006 14:12:53 -0400 From: Charlie Bowman <charlie@castlebranch.com> Subject: Re: [Rails] blank division after update To: rails@lists.rubyonrails.org Message-ID: <1149876774.25697.170.camel@charlie.castlebranch.com> Content-Type: text/plain; charset="us-ascii" Is this a typo? <%= @shizzlenitboo %> shouldn''t it be <%= @testvariable %> On Fri, 2006-06-09 at 20:09 +0200, Dorian wrote:> Hello all, > > Im having a slight problem with my website. I have a division that > is updated using a link_to_remote call. Now, inside the view I can put > plain text and everything is fine. However, if I try to pass a variable > from the controller to the view it does not work. For example I can > have this as the controller: > > def show_news > @testvariable = "shizzlenitboo" > end > > And inside the view I can put > <%= @shizzlenitboo %> > > Yet nothing will display. Does anyone know what is causing this? >Charlie Bowman Programmer Castle Branch Inc. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060609/e3dd88b8/attachment-0001.html ------------------------------ Message: 12 Date: Fri, 9 Jun 2006 20:21:59 +0200 From: Dorian <bigdorian@otherag.com> Subject: [Rails] Re: blank division after update To: rails@lists.rubyonrails.org Message-ID: <2aa2ae5794953f2071079db0844b6691@ruby-forum.com> Content-Type: text/plain; charset=utf-8 right, my fault I meant to say inside the view I could have <%= @testvariable %> and it will not display the contents of this variable in the division. Its just blank. Charlie Bowman wrote:> Is this a typo? > <%= @shizzlenitboo %> shouldn''t it be <%= @testvariable %> > > > On Fri, 2006-06-09 at 20:09 +0200, Dorian wrote: > >> end >> >> And inside the view I can put >> <%= @shizzlenitboo %> >> >> Yet nothing will display. Does anyone know what is causing this? >> > > Charlie Bowman > Programmer > Castle Branch Inc.-- Posted via http://www.ruby-forum.com/. ------------------------------ Message: 13 Date: Fri, 9 Jun 2006 20:23:38 +0200 From: Harry <harry.hambrick@extensity.com> Subject: [Rails] Re: Connecting to SQL Server 2000 database - errors To: rails@lists.rubyonrails.org Message-ID: <04600c3f87afc80a5fa62cb58dc58625@ruby-forum.com> Content-Type: text/plain; charset=utf-8 Roland Mai wrote:> Hello Harry, > > I posted some notes I took when I set up the MSDE 2000 on my blog: > > http://www.llafe.com/articles/2006/05/29/sql-server-msde-install-instructions > > I hope you find the right configuration there. > > The most common error is related to the database.yml. In it change the > host from localhost to (local). > > RolandThanks Roland, I looked at your blog and neither example there worked for me. I am running on an XP Professional machine with the SQL Server 2000 on a Windows Server 2000 machine, not on my local machine. Below is the configuration in my yml file. adapter: sqlserver database: cookbook username: sa password:trustm3 host: tpagpssql00 -- Posted via http://www.ruby-forum.com/. ------------------------------ _______________________________________________ Rails mailing list Rails@lists.rubyonrails.org http://lists.rubyonrails.org/mailman/listinfo/rails End of Rails Digest, Vol 21, Issue 195 **************************************