Monday, February 1, 2010

[Rails] Keeping a running count of user input

(Start disclaimer) New to ruby, new to rails, haven't programmed since
high school. (End disclaimer)

I am working on a personal project which I can use to track my golf
scores and progress but am having difficult keeping a running count of
the amount of holes played.

The app should work like this:
1. User starts the round - OK
2. Hole number is set to 1 - OK
3. User submits the first hole - OK
3a. Hole number is saved as 1 - OK
3b. Hole number increases by 1 - NOT OK
4. Redirect back to new - OK
Repeat until hole number = 18

How can I create a variable which will store the hole number for the
number of user inputs? Or should I write a loop which runs the input
form # times?

Thanks for any advice.

(The basic code I am working off of is a (very) slightly modified
scaffold)
--
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 post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate