similar to: Is there a automatic counter variable?

Displaying 20 results from an estimated 2000 matches similar to: "Is there a automatic counter variable?"

2009 Jun 05
15
Rails Code Indentation
Hi All, Rails code must be readable, formatted and well indented. I wanted to do indent code in my previous projects. Is there any built in rails plugin/gem that can help me to indent my existing code. Any ideas will be really appreciated ! NOTE: Please don''t suggest editor plugins. Thanks & Regards, Sandip R~ -- Ruby on Rails Developer http://sandip.sosblog.com
2007 May 05
4
Rails Installation Fails - InstantRails 1.3a
I downloaded InstantRails 1.3a, and unzipped it to c:\InstantRails I then ran gem install rails --include-dependencies in the Ruby Console Window A lot of it worked, but I saw these errors (with a bit of surrounding output) Installing RDoc documentation for activerecord-1.15.3... Installing RDoc documentation for actionpack-1.13.3... lib/action_controller/routing.rb:1061:30:
2005 Jul 19
1
Problems With MDB in Linux/Samba
I work for a company that has a program localy developed, and we were having a problem when we started storing the application on the samba shared drived mabye simular to what you are expereienceing. in ur smb.conf (usuly in /etc/samba/smb.conf) make sure on the shared drive in samba the oplocks are set (example below) ... <insert more smb.conf here> ;================= Clinic
2007 Feb 16
4
Ideas for rails
Here are a few suggestions, wondering what others thought: When you generate a model for a DB table, it would be nice if the model.rb contained the DB schema (kind of like # commented out schema) right in the model file. This would make reference WAY easier and put all of the DB stuff in one easy file. Thanks. also nice, of course, woudl be for rails to try and ''guess'' the
2012 Jun 20
3
How to iterate over an array? (with a counter)
Given an array, I''d like to iterate over it with a counter to produce something like this from a template: foo.0 = ARRAYVALUE0 foo.1 = ARRAYVALUE1 foo.2 = ARRAYVALUE2 (where ARRAYVALUEn is replaced by the value, and the foo.n is incremented for each value) The puppet templates support iteration, but I don''t see how to also increment a counter to get the behaviour above? Is
2007 Sep 07
7
Simple websites (no DB?) with Rails??
I have been learning Rails and building small things over the last several months. Question I have that has been surprising difficult to figure out is this (I know it seems somewhat nonsensical but ignore that). I recently started getting a few requests for basic website to be built, small businesses, stores, even individual people. How would one about doing such a thing using Rails? I may not
2006 Aug 11
6
Exporting to Excel ( all versions )
Hello, Thanks in advance for reading. I''m attempting to export data to an excel spreadsheet, and have done so successfully using RubySpreadsheet ( http://sourceforge.net/projects/rubyspreadsheet/ ) which is a port of the Perl WriteExcel module... Many of the methods however were left out, one of them being "insert_bitmap" and unfortunatley the bitmap is an important part
2008 Jun 13
6
Newbie question on has_many
I have two classes: a Widget and a User. The User has an id that is referenced in two places on the Widget: owner_id and operator_id. How should I structure that reference for has_many? Thanks folks - I appreciate any help on this. --David --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails:
2008 Mar 10
6
Probably OT, but CSS Help?
Ok I know this is off topic, but since you guys are usualy so helpful, I thought I''d try here first. Building a Rails App and one of the things we''ve done is put a CSS class of; * { font-family:"Lucida Grande",verdana,arial,helvetica,sans-serif; margin:0pt; padding:0pt; } Now the problem is that the padding setting, for one reason or another is killing my select
2004 Nov 05
8
Using Shorewall + Linux Virtual Server LVS/DR
I''m havign a HUGE amount of difficulty getting shoreline to work with LVS. We use it here constantly so we know it works. The problem is packets come in, get directed to a webserver, webserver returns the packet to firewall, and then it goes into a black hole. rp_filter is off globally on all interfaces. LVS seems to be working right.... I use shorewall tcrules to mark packets on
2006 Aug 16
4
New Model Object from Existing Model Object
Hey Guys, need a hand again.... Lets say I have an Order... and an Order has Order Lines and Order_Lines have Items... I want to create a New Order, which would have New Order Lines with the same Items... Is there a fast / easy way to do this, w/o having to create a new order, loop through all the order lines, and create them associating them with the Items? Any help would be great, thanks --
2008 May 14
5
RailsConf vs. My MacBook's Battery. ( Power Outlet Availability )
So my Macbook''s battery sucks... and I''m thinking of grabbing a new one, I''m curious how the availability of power outlets have been at RailsConfs. For those who have gone before, was it hard to find an outlet to plug into? Are they mindful of this? I hope so. Thanks in advance. --~--~---------~--~----~------------~-------~--~----~ You received this message because
2006 Feb 28
6
Problem with select and each_with_index
Disclaimer: Ruby newbie at work Thought I was going so well. Wanted to produce a select box from an array constant, with the indices returned as values , and the array values used as the descriptions. Checked out Ruby RDoc and saw there was an each_with_index method and came up with: <%= select (''type'', ''typecategory'', Typecategory.each_with_index
2008 Nov 04
3
Nester Resources, Routes and Class Inheritance
Ok here''s a quicky... but a goody :) We have models Company, Reference and Applicant... and References and Applicants just inherit from Company, and are basically companies with the type field set to reference... All companies can have a phone number associated with them, and phone number is a different model... I''m having trouble using the form_for method with a company that
2006 Aug 16
5
validation on methods that aren''t part of the database.
using the Rails Recipes book, i went through the tutorial on setting up authentication on a site. the tutorial was great, but it raises a few questions. the fields in the database are password_hash, and password_salt. the tutorial creates another method for password that takes the value it was given and hashes it and adds the 6 character salt at the end. what if i want to perform validation
2007 Jul 28
19
Harry Potter 5 - The order of the Phoenix
*Harry Potter 5 <http://www.gobsmack.info/Harry-Potter/>* *The Order of the Phoenix* *Harry Potter and His friends * ** *Wallpapers, Story and Video download* *Harry Potter 5 - The Order of the Phoenix<http://www.gobsmack.info/Harry-Potter/> * --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby
2006 Apr 03
2
Fast way of finding new position for model object?
I have a model object that acts as a list. The position of each object is determined by two factors: number of votes ascending and age of object descending. When a user adds or deletes a vote I need to quickly update the associated model object''s position. Right now this is done with the following method: def update_position position = nil Bug.find(:all, :order =>
2006 May 12
1
each_with_index. Can you start at a desired index position?
When using array.each_with_index how do you start at a desired index position? I can do it like this, but its not very clean and doesnt seem efficient : desired_index_start = 20 array.each_with_index do |value,index| next if index<desired_index_start end Thanks Chris -- Posted via http://www.ruby-forum.com/.
2009 Jul 16
9
Please help me understand how arrays are translated in rails
I''ve spent hours researching the subject and have tried many test sequences in IRB, and rails console but I''m just having trouble making headway into what is probably a very easy subject. I understand arrays with at least 4 other languages but with Ruby I haven''t found a mental connection with how I can assign variables to arrays.. Take for example: def
2006 Oct 13
5
Insert NULL into MySQL "time" not 00:00:00
Ok I''m not sure what I''m doing wrong, but I have a table that holds a bunch of times, however when I don''t fill in the text box that passes it''s input on to the variables, rails defaults to 00:00:00, which is bad, because that''s midnight. I''m pretty sure I''m doing somethign wrong, and I''m even thinking of using the