similar to: Traversing an object / array?

Displaying 20 results from an estimated 5000 matches similar to: "Traversing an object / array?"

2006 Feb 05
26
Ruby on Rails and other sites use PHP?
I can''t think of a good reason, other than it''s legacy code which hasn''t gotten around to being changed to RoR. http://rubyonrails.org/?=PHPE9568F36-D428-11d2-A769-00AA001ACF42 http://37signals.com/?=PHPE9568F36-D428-11d2-A769-00AA001ACF42 http://basecamphq.com/?=PHPE9568F36-D428-11d2-A769-00AA001ACF42 http://backpackit.com/?=PHPE9568F36-D428-11d2-A769-00AA001ACF42
2006 Apr 06
6
Flexible data schema in a database?
I figured I pose this to the list and see if any one can build a better mousetrap. The problem: 1. Store hierarchical data in a database, but without knowing the hierarchy beforehand. 2. Allow the user to define there own hierarchy, and allow the system to support multiple hierarchies. Call it a cataloging system, we have an object and we want to add data about that object to the system. Now
2006 Apr 03
7
global variable - @@var
I tried to keep track of the number of access to a specific controller. I declared ''@@mycount = 0'' in the controller class. The methods in the controller will increment the @@mycount (@@mycount = @@mycount + 1) and print the value to the html page and show in the browser. The value is always 1, no matter how many times I access the controller and its action(s). Is this
2006 Feb 01
8
ruby equivalent of isset()
Hi, Is there a way to test if a certain (local) variable has been initialized? I''d like to do something like if isset(myvar) and myvar.true? #some code else #default behaviour end I have a lot of shared views that I call with params such as { show_pager => true Instead of having to explicitly say show_pager => false it should be possible to make false a default value, right?
2006 Apr 11
6
Google Base... in Rails?
Ok, so this is kinda out of the blue... but I''ve been looking at Google Base and thinking that it''s got some really good ideas in it. Especially the way you can create your own "type" of item with its own custom attributes, like date range, location, number, text, etc. Kind of like defining a database with a GUI, but not exactly. It seems really interesting to me, from
2006 May 05
16
Diff tool for OSX
I''ve looked for DIFF tools for OSX but haven''t found anything good yet. Tried guiffy (http://www.guiffy.com) but it''s very slow and the folder comparison doesn''t indicate a change until you drill down to the level with the difference which kinda defeats the purpose. I''m missing TortoiseSVN and the diff tool that comes with it. Any suggestions for
2006 Feb 06
4
Searching large tables with Rails?
I have a large table (> 20,000 records) with text columns for which I need to build a search function. Is there a "Rails" way to index all the entries and NOT search using LIKE? "LIKE" searches can get very slow and I would rather build an index of the columns to speed up things. Just want to know if there is something like "acts_as_indexable"
2006 Jan 31
4
Rails to Java
Hello, I just started playing with RubyOnRails. It is indeed fascinating! I have a question about using rails models to connect to backend Java (i.e. EJBs) instead of database. Any pointers will be appreciated. Thanks and Regards, Khaled -- Posted via http://www.ruby-forum.com/.
2006 Jan 26
5
ruby and perl
Hello Community, is it possible to include perl scripts into a ruby view (.rhtml)? If yes, the structure has to be /public --> /cgi-bin like in a web application with cgi scripts? Best regards, Mathias -- Posted via http://www.ruby-forum.com/.
2005 Apr 01
11
I want to blog!
This isn''t Rails or Ruby related, but I just need some advice and thought I''d ask the bright individuals here. I want to start my own blog but I''m not sure where to begin. I don''t want to get a blogger account because I want to have my own domain. Blogger also doesn''t have many features. My hosting service is 1AND1 so it supports php, cgi and mysql.
2006 Jan 10
14
Not wishing to instigate a DB war, but...
Can I get some opinions on which free DB to use with rails for a virtual server that will eventually be doing lots of heavy database lifting? Not a lot of heavy duty querying per se. Think multiple simultaneous forums and blog sites and the like. I know each of the different DB possibilities such as MySQL and PostgreSQL has plus points and minus points. I''m particularly interested
2006 Jan 14
4
Rails URLs always try to open non-existent files
The lighttpd config file is set up like this... Rails url: //host/controller/method/id Lighttpd tries to open the file ''controller/method/id'' from the document root. Of course this doesn''t work and generates an error 404 This gets caught with: server.error-handler-404 = "/dispatch.fcgi" Which turns the request into "/dispatch.fcgi" That gets caught
2006 Feb 23
11
Sessions question
Hi, I''m a little confused about sessions. I have two objects, object "Apple" and object "Banana". These two objects have an N:M relationship. What I am doing is listing All of the Banana objects that are associated with a single Apple, then below that listing all of the Banana objects not associated with that same Apple. The user is then allowed to change the
2006 May 29
3
File.size() on Uploaded Images Fail
I am checking the file size of an uploaded file and storing it in a filesize column. It will work just fine when the user uploads any files other than images (jpg,png,gif). Word, Excel, Powerpoint, .zip and more all work fine. This is my model asset.rb that handles the file upload. def newfile=(newfile_field) self.filename = base_part_of(newfile_field.original_filename) self.filetype
2006 May 24
5
best way to return JSON?
I''m using Ajax.Updater to update a select element, and have just discovered that IE doesn''t like having its innerHTML set. I figure instead of a bunch of option tags I can return JSON and parse it to add the options, but I''m not quite sure of the best way to do this.... or any way to do it really :) Could someone point this out to me? Or am I using a totally antiquated
2006 Jan 07
2
hosting with Pair : Rails'' app dies after a few seconds
First of all thanks a lot to the guys who answered the other topic. Host: Pair Networks - FreeBSD v.4.8-Stable - peulik.pair.com PHP and MySQL services running (is this a problem?) First of all, after I establish the ssh connection I''ve to type, as I mentioned in the old thread, GEM_PATH ~/lib/ruby/gems/1.8 otherwise the ruby installation is not found. position of the executable:
2006 Jan 12
17
Application.rb params
I need to check if a parameter is set so that I can build some information for my application, but No matter how I format my if statement in the file " Application.rb" it return the following error. You have a nil object when you didn''t expect it! You might have expected an instance of Array. The error occurred while evaluating nil.[] Here is the line if params[:day] So we
2006 Feb 06
35
ROR Recipes Beta
Yesterday I got the beta version of ROR recipes book and the recipes are great. For those of you still thinking about it, I highly recommend the book. The only thing I wish is that if there were some more recipes (greedy me), especially AJAX related and installing an application within your current application. For instance, it will be great to see how one can implement the typo blog
2006 Apr 05
6
Howto add application-wide variables?
I suspect this is something I should know already but I can''t seem to get it right, how can I create application wide variables and have them accessible to all my controllers? I tried creating a plugin and having my controller require a specific method from that plugin to access its variables but that didn''t work, so I am left scratching my head. eg from plugin
2005 Nov 02
4
acts_as_metadata?
I''m running into the need (on at least one project now) to implement end-user-customizable "metadata" or properties on model objects. The standard example would be a Person class that had first_name, last_name, etc. but would need to be extended real-time (through the web admin interface) with properties such as phone_number : varchar (30). I''ve done some basic