search for: pragdave

Displaying 20 results from an estimated 23 matches for "pragdave".

2007 Nov 07
7
Help on loop
Hey, I have got a script that returns a long list of font family names, which I all want to store in a variable (array). I tried doing this with @f = font.family also in the for loop below but it only prints the last item when I want to display the results. require ''rubygems'' require ''RMagick'' include Magick for font in Magick.fonts puts font.family end
2006 Jun 11
3
[SUMMARY] Rails Core Weekly June 5 - June 11
...ai</a>. Symbol#to_proc does: <pre> {1 => "one", 2 => "two", 3 => "three"}.sort_by(&:first).map(&:last) #=> ["one", "two", "three"] </pre> (Earlier <a href="http://blogs.pragprog.com/cgi-bin/pragdave.cgi/Tech/Ruby/ToProc.rdoc">PragDave</a> called this "... an incredibly elegant use of coercion and of closures") _New Features in trunk (committed)_ David checked in <a href="http://dev.rubyonrails.org/changeset/4440">uninstall.rb</a> that makes it po...
2006 Feb 18
0
activerecord connections with xmlrpc
...,8080) begin param = client.call("get_username",123) puts "Hello #{param}" rescue XMLRPC::FaultException => e puts "Error:" puts e.faultCode puts "faultString = [#{e.faultString}]" end ------------------------------------------------------ "PragDave" had a recent blog on a related note: http://blogs.pragprog.com/cgi-bin/pragdave.cgi/Tech/Ruby/Connections.rdoc but again being a newbie to ruby/rails, my gymnastics with trying to put the ActiveRecord::Base.establish_connection() / ActiveRecord.connection() method in and out of various wrappe...
2005 Nov 09
1
Enterprise Integration with Ruby - Beta book
I saw this mentioned on Dave Thomas''s blog http://blogs.pragprog.com/cgi-bin/pragdave.cgi/Tech/Ruby/EIR.html and don''t remember having seen it announced on this mailing list. This new Beta Book is at http://pragmaticprogrammer.com/titles/fr_eir/index.html regards Justin
2006 Mar 09
3
How to copy between databases?
I want to copy data from one database to another using rails. But, it seems that rails only will talk to one database at a time. Is there a way around this? Any help would be greatly appreciated. -- Best Regards, -Larry "Work, work, work...there is no satisfactory alternative." --- E.Taft Benson -------------- next part -------------- An HTML attachment was scrubbed...
2006 Mar 16
5
Multiple databases + switching databases
Hello, I have an application that access two different DBMS - Firebird and Postgres. So far, that''s ok. The problem is, depending on the customer logged, a different database (Firebird) must be selected. To make the things clearer: Postgres: 1 database shared by all customers with these tables: - user - vehicle - driver Firebird: several databases with different names and identical
2007 Apr 28
6
RESTful web service tutorial?
Hi, I would like to turn some of our simulation codes out to pasture and string some of them together by draping them in web services. I''m looking for a RESTful Camping tutorial to get started ... pointers appreciated. Some simple example applications: airfoil force calculator: feed it an airfoil geometry, an angle of attack, and a Mach number, and it returns the lift, drag, and
2006 Jun 04
1
Preface to Agile 2nd edition book available?
So, is there a summary of the changes since the first edition? It would be helpful to see just exactly what in Ruby on Rails has changed before ordering the second edition of the book. Could somebody briefly describe changes to Rails since the version covered in the first edition of the book?
2006 May 04
1
Multiple database problem in rails 1.1 ?
...out nicely using a "establish_connection" per model, where each model enherit directly from ActiveRecord::Base. But ! I like to use a model where we can inherit from one parent class that handles the connection exactly as descripted in this document : http://blogs.pragprog.com/cgi-bin/pragdave.cgi/Tech/Ruby/Connections.rdoc The only problem is that my database (postgres) seems to be asked to find this parent class, but this should not have happend ! My Models looks like this : -- app/models/safe_record.rb class SafeRecord < ActiveRecord::Base establish_connection "safe_#{...
2006 Apr 19
1
Separate databases for reads and writes?
Hi all - New to rails... been reading as much as I can though and have yet to find a solid answer (although I think I found an unsolid negative). I''m wondering if there''s a way to split up the reads and writes in Rails so that pages/actions that don''t need to write can query from a group of mirrored databases. And my content managers can update a single master. I
2006 Feb 22
3
after_update: old, new values?
With after triggers in Postgres, there are special NEW and OLD vars accessible to trigger functions. Any such thing in Rails? Or would it entail doing something like setting a class var in before_update? Jack -- Posted via http://www.ruby-forum.com/.
2007 Feb 12
1
Migrations w/o Rails?
Does anyone know if it''s possible to use Active Record migrations in a non-Rails Ruby application (including ActiveRecord of course). Seems like a great tool for creating/maintaining an application database. I''ve tried but no success so far. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby
2006 Apr 18
2
Connecting to multiple databases with multiple database users
...t: localhost customer_authentication_development: adapter: mysql database: authentication username: customer password: host: localhost Following Chad Fowler''s Rails Recipe on multiple database connections and Dave Thomas'' blogentry at http://blogs.pragprog.com/cgi-bin/pragdave.cgi/Tech/Ruby/Connections.rdoc I created a subclass of ActiveRecord::Base to establish a connection for all models that only webadmin is allowed to CRUD. Although this is currently not working at the moment (see my previous post to this list) I''m pretty sure this is the way to go. The que...
2006 Jan 14
11
nuby: do models have to inherit directly from ActiveRecord?
Hello, I have a few models -- book, cd, dvd -- for which I''d like to have an abstract base superclass to hold some common stuff. That abstract class, I was thinking, would inherit from ActiveRecord. Didn''t work, though, and looking around, I found this: <http://wiki.rubyonrails.com/rails/pages/HowtoMakeAbstractModel>
2006 Nov 21
4
Embedding Rails in a Cocoa app.
Hi, Has anyone tried to embed rails into a Cocoa app? I have got this working to a very primitive point using RubyCocoa. After about half an hour of playing I was able to get WEBrick to serve the rails starter page inside of a Cocoa app, but that is as far as I have got. I have an idea for a client/server app where the server is a Cocoa application that embeds WEBrick (or another server solution
2006 Jul 25
9
Can anyone explain this code? It uses Inject
def webs @webs ||= Web.find(:all).inject({}) { |webs, web| webs.merge(web.address => web) } end -- Posted via http://www.ruby-forum.com/.
2009 Feb 20
6
rails 2.2.2 does not work with ruby 1.9.1
Hi everyone! I''ve installed new Ruby 1.9.1 from sources (http://www.ruby-lang.org/en/), then "gem install rails", everything was ok during installation, all tests ("make test") were ok too. After all, i wanted to create my new RoR project, but I could not start it. Plz help me Here is my terminal: [renat@localhost rails]$ rails mysite create create
2006 Mar 14
4
ruby-postgres: can''t convert string to integer
Hi everybody, I''m experiencing trouble when trying to use ruby-postgres with a legacy database I need access to. To me it seems the problem is the VARCHAR columns used there as primary keys. On a simple me = User.find(''PS12345'') I get a type error exception with the message ''can''t convert String into Integer''. The trace is:
2006 Jan 23
6
Ruby at O''Reilly Rough Cuts
Not sure if this is old news or not, but it would appear that both the Ruby Cookbook and a Rails book are now available for purchase at O''Reilly Rough Cuts (something akin to PragProg''s beta book program): http://rubyurl.com/nHz http://my.safaribooksonline.com/?mode=roughcuts&srchtext=ROUGHCUTS I haven''t tried them yet, but it definitely seems worth checking out.
2006 Sep 21
10
Can I use 2 DB connections in my app?
Hi there! How can i use 2 database connections in my rails application ( if it''s possible of course ): one for reading from DB and one for writing to DB? Thanks, Dmitry -- 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