[Rails] Re: Invoking browser from Ruby script with URL argument: How?

2011-08-09 Thread RichardOnRails
ave a wealth of good solutions: Yours, Colin's and Fred's Thanks to you and them, Richard On Aug 8, 7:32 pm, 7stud -- wrote: > RichardOnRails wrote in post #1015562: > > > Hi 7-stud, > > > Long time no "see".  Thanks for looking into my question. &

[Rails] Re: Invoking browser from Ruby script with URL argument: How?

2011-08-08 Thread RichardOnRails
Richard On Aug 8, 5:39 pm, Frederick Cheung wrote: > On Aug 8, 10:08 pm, RichardOnRails > > wrote: > > Colin, > > > > exec "firefox #{address}" > > I don't think this would work on a max, since GUI apps aren't normally > in $PATH. You might

[Rails] Re: Invoking browser from Ruby script with URL argument: How?

2011-08-08 Thread RichardOnRails
rough Rails source code, thinking I might find a clue there. But that seemed daunting to me. Best wishes, Richard On Aug 8, 4:32 pm, Colin Law wrote: > On 8 August 2011 19:10, RichardOnRails > > wrote: > > Hi, > > > I've got the folowing script: > > re

[Rails] Re: Invoking browser from Ruby script with URL argument: How?

2011-08-08 Thread RichardOnRails
Hi 7-stud, Long time no "see". Thanks for looking into my question. > file://K:/_Utilities/Apache/xampp/apache/htdocs/index.html > > isn't a command. Yeah, I know, but my question is how to repair my code so that it works. Or more specifically, what command can I take which accepts the text o

[Rails] Invoking browser from Ruby script with URL argument: How?

2011-08-08 Thread RichardOnRails
Hi, I've got the folowing script: require "fileutils" path = "K:/_Utilities/Apache/xampp/" FileUtils::cd path names = Dir.glob("**/index.html") (0..4).each { |i| name = names[i] address = "file://" + path + name puts address exec address } It runs fine without line 10, "e

[Rails] Re: Validation problem

2010-08-12 Thread RichardOnRails
lot of pounding to get me to see the point of view you guys have been espousing. Thankfully, I'm finally on board with you guys. Best wishes, Richard On Aug 9, 11:16 am, Colin Law wrote: > On 9 August 2010 16:08, RichardOnRails > > wrote: > > Hi Hassan, > > >>

[Rails] Re: Validation problem

2010-08-12 Thread RichardOnRails
et-Programming environment. Thanks to you, et al, for getting that cleared up for me. Best wishes, Richard On Aug 9, 11:16 am, Marnen Laibow-Koser wrote: > RichardOnRails wrote: > > Hi Hassan, > > >> > It can't be nil. When the form is instantiated > > >>

[Rails] Re: Validation problem

2010-08-12 Thread RichardOnRails
onse for data-type, range, etc. regardless of how the form I provided the user was set up. Is that the correct mindset, as you perceive the problem? Many thanks to you and Hassan, Richard On Aug 10, 5:05 pm, Ar Chron wrote: > RichardOnRails wrote: > > > So what do I fail to understan

[Rails] Re: Validation problem

2010-08-10 Thread RichardOnRails
wishes, Richard On Aug 10, 3:30 pm, RichardOnRails wrote: > Hi Hassan, > > > > I've code exactly the logic I wanted, except for how to enforce that a > > > vendor be selected from the drop-down before creating a new expense > > > record. > > > Which

[Rails] Re: Validation problem

2010-08-10 Thread RichardOnRails
proach failed with Rails displaying the params as I described the, the crash was in am instance of an Expense model, so I On Aug 9, 11:18 am, Hassan Schroeder wrote: > On Mon, Aug 9, 2010 at 8:08 AM, RichardOnRails > > wrote: > >> I'd suggest that it's good practic

[Rails] Re: Validation problem

2010-08-10 Thread RichardOnRails
ided by Agile Web Dev w/ Rails, et al. Sound reasonable? On Aug 9, 11:16 am, Colin Law wrote: > On 9 August 2010 16:08, RichardOnRails > > wrote: > > Hi Hassan, > > >> > It can't be nil.  When the form is instantiated > > >> Assuredly, it can be --

[Rails] Re: Validation problem

2010-08-10 Thread RichardOnRails
Hi Marnen, > a tool like curl I found a bunch of Google hits on it. I'll have to study them. Thank for the tip, Richard On Aug 9, 11:16 am, Marnen Laibow-Koser wrote: > RichardOnRails wrote: > > Hi Hassan, > > >> > It can't be nil. When the form is ins

[Rails] Re: Validation problem

2010-08-09 Thread RichardOnRails
Hi Hassan, > > It can't be nil.  When the form is instantiated > > Assuredly, it can be -- a request can be generated without your form > being involved at all. I don't get it. Can you point me to some tutorial that deals with this issue? > I'd suggest that it's good practice to handle any (eve

[Rails] Re: Validation problem

2010-08-09 Thread RichardOnRails
Thanks for your response. That fulfilled my implementation goal perfectly. Best wishes, Richard On Aug 8, 11:41 pm, Ar Chron wrote: > RichardOnRails wrote: > > Hi All, > > > I've got an Expense model as follows: > > > class Expense < ActiveRecord::Base &

[Rails] Re: Validation problem

2010-08-08 Thread RichardOnRails
eeds to: 1. present an error-message at the top of the form 2. re-display all other form elements with their current content Make sense? Best wishes, Richard On Aug 8, 8:48 pm, Hassan Schroeder wrote: > On Sun, Aug 8, 2010 at 4:18 PM, RichardOnRails > > wrote: > > I've got

[Rails] Validation problem

2010-08-08 Thread RichardOnRails
Hi All, I've got an Expense model as follows: class Expense < ActiveRecord::Base belongs_to :vendor def validate_on_create unless params["expense"]["vendor_id"] != "0" # <= Line 5 errors.add("A vendor must be selected before creating the expense record") end end end that c

[Rails] Re: Prefix a drop-down with "Select Item" -- Rails way?

2010-08-02 Thread RichardOnRails
theless, thank you for confirming what I thought about today. Best wishes, Richard On Jul 20, 4:24 pm, Dave Aronson wrote: > On Tue, Jul 20, 2010 at 16:08, RichardOnRails > > wrote: > > I know of no threshold of Rails expertise before posting questions on > > this newsgroup.

[Rails] Re: Prefix a drop-down with "Select Item" -- Rails way?

2010-07-20 Thread RichardOnRails
> I would suggest that RichardOnRails brush up on MVC. Why don't you say explicitly how I can avoid offending your sensibility about MVC? I know of no threshold of Rails expertise before posting questions on this newsgroup. I suspect that people with high levels of Rails respond to a

[Rails] Prefix a drop-down with "Select Item" -- Rails way?

2010-07-20 Thread RichardOnRails
Hi, I'm finally a happy developer of a Rails app that's got a working drop- down. In short, I prefixed the array of Vendors (which all have integer IDs > 0) with an new Vendor with in ID of 0 and a string "Select ..." in the field that populates the drop down. I'll use some kind of "before" comm

[Rails] Re: Added associations but don't see generated methods

2010-07-19 Thread RichardOnRails
3:03 am, Colin Law wrote: > On 19 July 2010 00:56, RichardOnRails > > wrote: > > In stead of the observer idea, how about switching to an option > > containing the link-record creation/population with the caveat that > > the join-table be checked for the existence of a

[Rails] Re: Added associations but don't see generated methods

2010-07-18 Thread RichardOnRails
request. That sounds pretty simple. Any fans of this idea? Best, Richard On Jul 18, 6:13 pm, RichardOnRails wrote: > Hey Guys, > > How about this idea. > 1.  We revert to vendor as the first arg to collection_select. > 2.  That populates params["expense"]["vendor&quo

[Rails] Re: Added associations but don't see generated methods

2010-07-18 Thread RichardOnRails
d populate it with: a. The new Expense record's ID b. The selected vendor's ID c. Save the the join record. Ideally, that's what collection_select would do for us if we could invoke it in just the right way. Any votes in favor of this idea? Best wishes, Richard On Jul

[Rails] Re: Added associations but don't see generated methods

2010-07-18 Thread RichardOnRails
OK Guys, I think I understand the problem now. We've got to populate the join- table with the ID of the new Expanse record and the ID of the selected Vendor record. Heretofore, I thought using vendor instead of Fred's vendor_id was cool because: 1. It didn't crash the new Expense record 2. It

[Rails] Re: Added associations but don't see generated methods

2010-07-18 Thread RichardOnRails
Hey Fred and Colin, > I presume you *have* got a vendor_id column in the expenses table? No, I don't. I thought that's the kind of thing was generated dynamically. But now that you ask, I see that dynamic generation of methods would extend to the addition of columns to tables On second though

[Rails] Re: Added associations but don't see generated methods

2010-07-18 Thread RichardOnRails
Before I start, let me mention that I have posted a Microsoft Word document of the following response, along with two relevant files of the app here: http://www.filefactory.com/file/b29ea4f/n/Problem_writing_out_a_new_expense_record.doc http://www.filefactory.com/file/b29ea3c/n/new.html.erb http:/

[Rails] Re: Added associations but don't see generated methods

2010-07-18 Thread RichardOnRails
tilities/ruby186-26_rc2/ruby/lib/ruby/gems/1.8/gems/rack-1.0.1/ lib/rack/handler/mongrel.rb:34:in `run' K:/_Utilities/ruby186-26_rc2/ruby/lib/ruby/gems/1.8/gems/rails-2.3.5/ lib/commands/server.rb:111 K:/_Utilities/ruby186-26_rc2/ruby/lib/ruby/site_ruby/1.8/rubygems/ custom_require.rb:31:

[Rails] Re: Added associations but don't see generated methods

2010-07-17 Thread RichardOnRails
ms" in the command window and got the same display (except less neatly) as the hash I got in the crash dump. Give all that, I still have no idea why the app crashed. Do you have any idea? Best wishes, Richard On Jul 17, 4:33 pm, Colin Law wrote: > On 17 July 2010 15:50, RichardOnRails >

[Rails] Re: Added associations but don't see generated methods

2010-07-17 Thread RichardOnRails
cord-2.3.5/lib/active_record/base.rb:2438:in `initialize' K:/_Projects/Ruby/_Rails_Apps/_EIMS/RTS/app/controllers/ expenses_controller.rb:44:in `new' K:/_Projects/Ruby/_Rails_Apps/_EIMS/RTS/app/controllers/ expenses_controller.rb:44:in `create' On Jul 17, 9:24 am, RichardOnRails

[Rails] Re: Added associations but don't see generated methods

2010-07-17 Thread RichardOnRails
. If you can give me a little more help about this problem, I'd be most appreciative. If you need more info, I'd be happy to post portions or all my code to a website from which you could download it for inspection. Best wishes, Richard On Jul 17, 5:29 am, Frederick Cheung wrote: > O

[Rails] Re: Added associations but don't see generated methods

2010-07-16 Thread RichardOnRails
Hey Colin, Here's one more detail I should have added from my new-expense-view code: <%= f.label :vendor %> <%# New version of vendor selection -%> <% params[:expense] = 10 -%> <% @vendors = Vendor.find( :all, :order=>"nickname ASC") -%> <%= f.collection_select(:id, @vendors,

[Rails] Re: Added associations but don't see generated methods

2010-07-16 Thread RichardOnRails
Here are the details I intended to add to my last post: >> expense = Expense.find(:last) => #http://groups.google.com/group/rubyonrails-talk?hl=en.

[Rails] Re: Added associations but don't see generated methods

2010-07-16 Thread RichardOnRails
: > On 16 July 2010 20:31, RichardOnRails > > > > wrote: > >> Post back if you have any more problems. > > Thanks for your generous offer.  So here's my last (I hope) stumbling > > block. I got: > > >  NoMethodError in Expenses#new > > >

[Rails] Re: Added associations but don't see generated methods

2010-07-16 Thread RichardOnRails
Thanks for weighing in here about my problem. Things are looking up. Best wishes, Richard On Jul 16, 11:06 am, Bill Walton wrote: > Hi Richard, > > On Fri, Jul 16, 2010 at 9:32 AM, RichardOnRails wrote:> > >http://rails.rubyonrails.org/classes/ActiveRecord/Associations/Cla

[Rails] Re: Added associations but don't see generated methods

2010-07-16 Thread RichardOnRails
> Post back if you have any more problems. Thanks for your generous offer. So here's my last (I hope) stumbling block. I got: NoMethodError in Expenses#new Showing app/views/expenses/new.html.erb where line #14 raised: undefined method `merge' for :nickname:Symbol Extracted source (around lin

[Rails] Re: Added associations but don't see generated methods

2010-07-16 Thread RichardOnRails
Hi Andy, >> expense = Expense.find(1) => #> expense.vendor.nil? => true >> quit > Welcome to dynamic objects and classes :-) Thanks. This restores my faith in Rails and enhances my appreciation of newsgroups, especially this one. Now I've got to put them to use! Best wishes, Richard On Jul 16

[Rails] Re: Added associations but don't see generated methods

2010-07-16 Thread RichardOnRails
ned? IMHO, that would substantially limit the usefulness of relationship macros. Thanks again, Richard On Jul 16, 10:46 am, Frederick Cheung wrote: > On Jul 16, 3:32 pm, RichardOnRails > > > > wrote: > > Hi, > > > I've got a Rails app working that includes two two c

[Rails] Added associations but don't see generated methods

2010-07-16 Thread RichardOnRails
Hi, I've got a Rails app working that includes two two classes, etc.: Expense & Vendor. I eventually learned that the mental concept I had of their relationship should be express in Rails as: class Expense < ActiveRecord::Base; belongs_to :vendor; end class Vendor < ActiveRecord::Base; has_m

[Rails] Re: Getting belongs_to and has_many working: good plan?

2010-07-13 Thread RichardOnRails
Hey Fred, Thanks for you additional guidance on my introduction of belongs_to, etc. > wrote: > > > Assuming Vendor belongs_to :expense then > > > f.collection_select :vendor_id, @vendors, :id, :name > > > would do the trick > > > Au contraire:  My concept is that every Expense belongs to some >

[Rails] Re: Getting belongs_to and has_many working: good plan?

2010-07-13 Thread RichardOnRails
Hi Fred, Thanks for looking into my problem. > That's setting yourself up for has_and_belongs_to_many ... (the earlier > snippet from > your models suggests no) Right, I don’t want that. I want: An Expense has a Vendor. A Vendor has many Expenses. I believe that’s reflected in: app\models\vend

[Rails] Re: Getting belongs_to and has_many working: good plan?

2010-07-12 Thread RichardOnRails
d in the join-table, rather than the vendor's name saved in the expense record. This should be my last hurdle for this application. Any guidance will be most appreciated. I didn't see an answer on the sites we've talked about. Thanks in Advance, Richard On Jul 12, 9:45 pm, Mar

[Rails] Re: Getting belongs_to and has_many working: good plan?

2010-07-12 Thread RichardOnRails
rails guide.  Basically all > you need is a foreign key pointing both directions in the join table. > > http://guides.rubyonrails.org/association_basics.html#the-has-and-bel... > > On Jul 12, 7:24 pm, Marnen Laibow-Koser wrote: > > > RichardOnRails wrote: > > > I ju

[Rails] Re: Getting belongs_to and has_many working: good plan?

2010-07-12 Thread RichardOnRails
, Marnen Laibow-Koser wrote: > RichardOnRails wrote: > > I just added these linkage statements to my Expense and Vendor models, > > respectively. > > Which?  You neglected to say.  > > >  > > I found a "HOWTO: Beginning Relationships" > > web

[Rails] Re: Getting belongs_to and has_many working: good plan?

2010-07-12 Thread RichardOnRails
On Jul 12, 8:24 pm, Marnen Laibow-Koser wrote: > RichardOnRails wrote: > > I just added these linkage statements to my Expense and Vendor models, > > respectively. > > Which?  You neglected to say.  Change the Expense model:: app\models\expense.rb class Expense

[Rails] Getting belongs_to and has_many working: good plan?

2010-07-12 Thread RichardOnRails
I just added these linkage statements to my Expense and Vendor models, respectively. I found a "HOWTO: Beginning Relationships" webpage (http://www.railsforum.com/viewtopic.php?id=265). That leads me to think that I need to: 1. Create migration Add_Vendor_ID_to_Expense and then add column vendor_

[Rails] Re: Rake complains about missing "default" task

2010-07-11 Thread RichardOnRails
eder wrote: > On Sun, Jul 11, 2010 at 9:51 AM, RichardOnRails > > wrote: > > > I got took one of the first examples of the website I cited before, > >> >http://jasonseifer.com/2010/04/06/rake-tutorial > > and found that it didn't work "in any direct

[Rails] Re: Rake complains about missing "default" task

2010-07-11 Thread RichardOnRails
7;tmp/hello.tmp'...] K:/_Projects/Ruby/_Rails_Apps/_EIMS/Tools/RakeExamples/Example01/ rakefile:9 (See full trace by running task with --trace) >Exit code: 1 =end On Jul 9, 6:28 pm, Hassan Schroeder wrote: > On Fri, Jul 9, 2010 at 2:42 PM, RichardOnRails > > wrote: > > I got

[Rails] Rake complains about missing "default" task

2010-07-09 Thread RichardOnRails
Hi, I got an example rakefile from the webpage http://jasonseifer.com/2010/04/06/rake-tutorial which displays "Published: April 6, 2010 at 4:25 AM" Below are my results from testing that rakefile in a Command window on WinXP-Pro/SP3 running Rails 2.3.5, where Rake complained "Don't know how to bu

[Rails] Re: Simple routing problem

2010-07-08 Thread RichardOnRails
Hi Colin, > Have a look at the Rails Guide on routing. Good idea. I'm still stuck on that.issue. Thanks. Best wishes, Richard On Jul 6, 3:20 am, Colin Law wrote: > On 6 July 2010 05:39, RichardOnRails > > wrote: > > Hey Niels, > > > Thank you for excellent gu

[Rails] Re: Simple routing problem

2010-07-05 Thread RichardOnRails
you are using erb).  Replace path_to_controller_views > with either /app/views/users or /app/views/sessions as appropriate. > > Niels > > On Jul 5, 2010, at 10:02 PM, RichardOnRails wrote: > > > I've got the following in config\routes.rb: > > map.resources :users

[Rails] Simple routing problem

2010-07-05 Thread RichardOnRails
I've got the following in config\routes.rb: map.resources :users In app\views\shared\_menu.erb, I've got: Please sign in <%= link_to "here", :controller=>"user", :action=>"sign_in" -%> In app\controllers\users_controller.rb def sign_in end When I run the application, I crash with: Routing

[Rails] Re: About "Rails Recipes", Fowler, 2006

2010-07-05 Thread RichardOnRails
answerable, or because neither of you can answer it with the facts as I presented them? As Hamlet said so eloquently, "That is the question." Best,. Richard On Jul 5, 9:07 pm, Marnen Laibow-Koser wrote: > RichardOnRails wrote: > > Hi Juan & Marnen, > > >> Marn

[Rails] Re: About "Rails Recipes", Fowler, 2006

2010-07-05 Thread RichardOnRails
Hey guys, On top of my other problems, I inadvertently clicked a link labeled "Report as spam" to Google Groups. I'm going to see if there's a way to undo that. I apologize for that mistake. Best wishes, Richard On Jul 5, 8:47 pm, RichardOnRails wrote: > Hi Juan &a

[Rails] Re: About "Rails Recipes", Fowler, 2006

2010-07-05 Thread RichardOnRails
lugin > is developed. > > -- > Mis mejores deseos, > Best wishes, > Meilleurs vœux, > > Juan Pablo > --http://www.twitter.com/eljuanchosf > > 2010/7/5 Marnen Laibow-Koser > > > RichardOnRails wrote: > > > Hi

[Rails] Re: About "Rails Recipes", Fowler, 2006

2010-07-05 Thread RichardOnRails
et} I've got a route: map.resources :users Do you care to offer me any suggestions? I'd be most appreciative. Best wishes, Richard On Jul 5, 1:03 am, Marnen Laibow-Koser wrote: > RichardOnRails wrote: > > Hi, > > > I'm following Chad's Recipe 31, "

[Rails] About "Rails Recipes", Fowler, 2006

2010-07-04 Thread RichardOnRails
Hi, I'm following Chad's Recipe 31, "Authenticating your Users". After getting some of it working, I noticed that he had put some of his models and controllers under a separate Authentication directory under the directory created originally with, say, a "rails MyApp" command. Question: Am I li

[Rails] Re: How to populate a table with id of selected item from another table

2010-06-29 Thread RichardOnRails
post back how I solved my problem using those resources, should I be so fortunate. Best wishes, Richard On Jun 28, 4:42 pm, Hassan Schroeder wrote: > On Mon, Jun 28, 2010 at 1:06 PM, RichardOnRails > > wrote: > > undefined local variable or method `nickname' for # > 0x442c

[Rails] Re: How to populate a table with id of selected item from another table

2010-06-28 Thread RichardOnRails
html.erb:10:in `_run_erb_app47views47expenses47new46html46erb' K:/_Projects/Ruby/_Rails_Apps/_EIMS/RTS/app/views/expenses/ new.html.erb:5:in `_run_erb_app47views47expenses47new46html46erb' K:/_Projects/Ruby/_Rails_Apps/_EIMS/RTS/app/controllers/ expenses_controller.rb:30:in `new' R

[Rails] Re: How to populate a table with id of selected item from another table

2010-06-28 Thread RichardOnRails
ot; in the f.collection_select statement to no avail; besides, the documentation you referred to suggested a bareword. 4. Any ideas? Thanks in Advance, Richard On Jun 27, 2:14 pm, Hassan Schroeder wrote: > On Sun, Jun 27, 2010 at 10:00 AM, RichardOnRails > > wrote: > > Okay, guys

[Rails] Re: How to populate a table with id of selected item from another table

2010-06-27 Thread RichardOnRails
need to do something about possible nil in the nickname field, maybe: nickname ||= "". If you guys are up to it, I'd appreciate any observations you may care to offer. Best wishes, Richard On Jun 27, 4:28 am, RichardOnRails wrote: > Hi, > > I have a "New Expense&q

[Rails] Re: How to populate a table with id of selected item from another table

2010-06-27 Thread RichardOnRails
mission, have the selected vendor's ID stored in the database rather than the selected name. Best wishes, Richard On Jun 27, 4:28 am, RichardOnRails wrote: > Hi, > > I have a "New Expense" form that includes a select field named vendor > that provides a a drop-down list

[Rails] How to populate a table with id of selected item from another table

2010-06-27 Thread RichardOnRails
Hi, I have a "New Expense" form that includes a select field named vendor that provides a a drop-down list of all vendors. When a user makes a selection of a vendor-name, that name populates the vendor field of the new Expense record. I'm happy with the drop- down list of names, but I'd rather

[Rails] Re: Rake sporadic: worik

2010-06-25 Thread RichardOnRails
Please forget about this post. After a good nap, I see where I got confused. If you looked at this post, I'm sorry I wasted your time. Best wishes, Richard On Jun 25, 11:21 pm, RichardOnRails wrote: > Hi, > > I tried to invoke rake from a Command Window, with a couple of > f

[Rails] Re: Rake sporadic: worik

2010-06-25 Thread RichardOnRails
I accidentally hit the Return key prematurely. The subject should have been something like: Rake fails sporadically - it runs with one working directory but not a couple of others. I apologize for the sloppiness. On Jun 25, 11:21 pm, RichardOnRails wrote: > Hi, > > I tried to invoke ra

[Rails] Rake sporadic: worik

2010-06-25 Thread RichardOnRails
Hi, I tried to invoke rake from a Command Window, with a couple of failures and one success. I haven't consciously done anything to my system to impact rake Any idea what's going on? First try: K:\>rake --trace rake aborted! No Rakefile found (looking for: rakefile, Rakefile, rakefile.rb, Rakef

[Rails] Re: Ruby breakpoint has weird idea of what local_variables a

2010-06-04 Thread RichardOnRails
ath. Nevertheless, thanks for asking. I WILL get back to A.S. soon. Best wishes, Richard On Jun 4, 7:34 pm, Marnen Laibow-Koser wrote: > RichardOnRails wrote: > > Hi Marnen, > > >> ActiveScaffold is dead simple to use.  Perhaps if you were to ask > >> questions abo

[Rails] Re: Ruby breakpoint has weird idea of what local_variables a

2010-06-04 Thread RichardOnRails
to manipulate a Rails app is fun. And I did post my question on the Ruby NG and Robert Klemme was helpful there. Talk to you soon, no doubt, Richard On May 31, 3:44 pm, Marnen Laibow-Koser wrote: > RichardOnRails wrote: > > Geez, Marnen, > > > I don't see why people on

[Rails] Re: Ruby breakpoint has weird idea of what local_variables a

2010-05-31 Thread RichardOnRails
s-app administration tool. Best wishes, Richard On May 31, 1:39 pm, Marnen Laibow-Koser wrote: > RichardOnRails wrote: > > Hi, > > > I've got a 7-liner: > > require 'rubygems' > > require 'breakpoint' > > > a = 'aaa' &g

[Rails] Ruby breakpoint has weird idea of what local_variables are?

2010-05-31 Thread RichardOnRails
Hi, I've got a 7-liner: require 'rubygems' require 'breakpoint' a = 'aaa' b = 'bbb' breakpoint c = 'ccc' In a Command window, I've got: K:\_Projects\Ruby\_Ruby_Tests\TestBreakpoint>ruby TestBreakpoint.rb Executing break point at TestBreakpoint.rb:9 irb(main):001:0> local_variables => ["id", "blo

[Rails] Re: Unit Test newbie problem

2010-05-22 Thread RichardOnRails
Will do! Best wishes, Richard On May 19, 10:08 am, Marnen Laibow-Koser wrote: > RichardOnRails wrote: > > Thanks for your help.  My faith the Unit Test *really* works is > > strengthening :-) > > Excellent!  When you get a chance, try RSpec, see how much nicer it is,

[Rails] Re: Unit Test newbie problem

2010-05-19 Thread RichardOnRails
;,  crud_views_as_a_string(), > "Surprise") > > On May 16, 8:43 pm, RichardOnRails > > > > wrote: > > Hi All, > > > I got a set of tests for a Ruby app.  The first fails unexpectedly > > ("wrong number of args").  I added code to show tha

[Rails] Re: Integrate new fields in a table with CRUD functionality:

2010-05-18 Thread RichardOnRails
I'd like some kind soul to point me to them. I posted these questions on http://groups.google.com/group/activescaffold/topics, but its awaiting admin. approval before being displayed. Hence this post in this thread. Any ideas are most welcome. Regards, Richard On May 17, 5:36 pm, Ma

[Rails] Re: Integrate new fields in a table with CRUD functionality:

2010-05-17 Thread RichardOnRails
s been a beneficial odyssey for my Ruby/Rails growth. Best wishes, Richard On May 17, 5:36 pm, Marnen Laibow-Koser wrote: > RichardOnRails wrote: > > Hi paving, > > > Thanks very much for your response to my complaint about lack of Rails > > support for handling changes

[Rails] Re: Integrate new fields in a table with CRUD functionality:

2010-05-17 Thread RichardOnRails
, Richard On May 17, 4:01 am, pavling wrote: > On 17 May 2010 03:30, RichardOnRails > > wrote: > > > > > > I feel like writing a generator to populate views when > > columns are added/renamed/dropped from a DB table.  It annoys my that > > there's n

[Rails] Re: Unit Test newbie problem

2010-05-17 Thread RichardOnRails
programming. Best wishes,] Richard On May 17, 10:04 am, RichardOnRails wrote: > Minor correction: > > Viewhttp://www.pastie.org/963750instead of the "pastie" link I > provided earlier. > > My minor error was that the first line of TestGMC.rb was a comment > with the

[Rails] Re: Unit Test newbie problem

2010-05-17 Thread RichardOnRails
piness. Best wishes, Richard On May 17, 8:42 am, RichardOnRails wrote: > Hi Marnen and Frederick, > > Thanks for looking into my problem. > > Frederick:  I removed the colons from the public and private macros > Marnen:  The code and the output I got from running them is >

[Rails] Re: Unit Test newbie problem

2010-05-17 Thread RichardOnRails
s the second line in:: assert_equal( "edit, index, new, show", crud_views_as_a_string(:string), "Surprise") Thanks again, Richard On May 17, 5:32 am, Frederick Cheung wrote: > On May 17, 4:43 am, RichardOnRails > > wrote: > > module GMC_mod >

[Rails] Re: Integrate new fields in a table with CRUD functionality:

2010-05-16 Thread RichardOnRails
nto my desired test. If I have too many disappointments, I'll try out BDD to see if it's any better. Best wishes,] Richard On May 16, 11:37 pm, Marnen Laibow-Koser wrote: > RichardOnRails wrote: > > Hi Colin, > > >> I think Toyota may be an better compariso

[Rails] Unit Test newbie problem

2010-05-16 Thread RichardOnRails
Hi All, I got a set of tests for a Ruby app. The first fails unexpectedly ("wrong number of args"). I added code to show that the app works as I think it should. Any ideas? The code is below: I'm running: Rails 2.3.5, Ruby 1.8.6, WinXP-Pro/SP3, Firefox 3.6.2, Firebug 1.5.3, MySQL 5.0.37-commu

[Rails] Re: Integrate new fields in a table with CRUD functionality:

2010-05-16 Thread RichardOnRails
my entire reply. BTW, as I mentioned to Colin, I've been playing around with unit- testing today. I feel like writing a generator to populate views when columns are added/renamed/dropped from a DB table. It annoys my that there's no tool to do that. Best wishes as always, Richa

[Rails] Re: Integrate new fields in a table with CRUD functionality:

2010-05-16 Thread RichardOnRails
Hi Colin, > I think Toyota may be an better comparison. Good point. BTW, I started to employ unit-tests. You and Marnen have beaten me into submission :-) Sincere best wishes, Richard On May 16, 3:29 am, Colin Law wrote: > On 16 May 2010 01:59, RichardOnRails > > wrote: >

[Rails] Re: Integrate new fields in a table with CRUD functionality:

2010-05-15 Thread RichardOnRails
ppy that you have that luxury. But I'm a version of the earlier you. So, like you, I get to Agile-land. But, like St. Augustine, I'll give up sin, but not right now :-) Very best wishes, with appreciation of your insights, Richard On May 15, 8:16 pm, Marnen Laibow-Koser wrote: &

[Rails] Re: Integrate new fields in a table with CRUD functionality:

2010-05-15 Thread RichardOnRails
I forgot to post the symptom. When I tried to recreate it, the symptom. I have a better one, but I'll post it on a new thread. So, forget the last post. Thanks again, Richard On May 15, 8:13 pm, RichardOnRails wrote: > Hi guys, > > I started the manual process on four file

[Rails] Re: Integrate new fields in a table with CRUD functionality:

2010-05-15 Thread RichardOnRails
vance for any ideas you might offer, Richard On May 15, 7:49 pm, RichardOnRails wrote: > Thanks for an additional response, Marnen. > > > Not quite.  You do not need to change your model at all -- it will > > figure out that the extra DB fields are there. > > Interesting ..

[Rails] Re: Integrate new fields in a table with CRUD functionality:

2010-05-15 Thread RichardOnRails
ants results, and I am responding to his wishes. You have my word that I'll get Agile-ized after we reach a working version 1 (or 1.1 ...). I promise :-) Thanks to you and Colin for spending time on a wretch like me :-), Richard On May 15, 7:00 pm, Marnen Laibow-Koser wrote: > RichardOnRai

[Rails] Re: Integrate new fields in a table with CRUD functionality:

2010-05-15 Thread RichardOnRails
any sense to you guys? Should I just forget my wish to Rails' tools and make my humble changes manually? Again, thanks for taking the time to consider my questions, Richard On May 15, 4:17 pm, Colin Law wrote: > On 15 May 2010 19:53, RichardOnRails > > > > wrote: > &g

[Rails] Re: Integrate new fields in a table with CRUD functionality:

2010-05-15 Thread RichardOnRails
Thanks for your response. Yes. The model consists only of the empty class definition. But it's got views for show, new, etc. However, none of these views are updated to reflect my new and renamed fields. On May 15, 1:53 pm, Marnen Laibow-Koser wrote: > RichardOnRails wrote

[Rails] Integrate new fields in a table with CRUD functionality: simple question

2010-05-15 Thread RichardOnRails
Hi, I've got an "expenses" table which I modified as follows: added column "account_number" renamed column "type" to "transaction_type" Can I add CRUD for the columns with: first: ruby script/generate model expense then: ruby script/controller expense Will all the existing CRUD for other colum

[Rails] Re: Changing names in an app -- advice wanted

2010-05-14 Thread RichardOnRails
Hi, Thanks for you feedback. My custom search.rb and transform.rb programs did the job, I think. No test programs were implicated because I'm delinquent on employing formal testing on my first real Rails app. I know its sinful, but I survived a career of computer consulting without formal testi

[Rails] Re: Changing names in an app -- advice wanted

2010-05-13 Thread RichardOnRails
Hey Phil, One more question: I should only make changes in .rb and .erb files subordinate to the app directory, right? Thanks again, Richard On May 13, 4:27 pm, Philip Hallstrom wrote: > > I've got an app close to ready as version 1,  but client wants labels > > on a form and corresponding colu

[Rails] Re: Changing names in an app -- advice wanted

2010-05-13 Thread RichardOnRails
Hi Philip, Thanks for your fast and thoughtful response. I had posted that I was going to embark on a fresh implementation, but now I'm encouraged to try the migration+grep approach. But I'll use Ruby to apply the grep. Using perl feel like now gone 20th century :-) Best wishes, Richard On Ma

[Rails] Re: Changing names in an app -- advice wanted

2010-05-13 Thread RichardOnRails
Hi, Maybe the best way is just to recreate the app using the new names and then re-implement the enhancements I added to reach the current version. I'm going to start that approach while I wait for some advice about a better way. Regards, Richard On May 13, 4:18 pm, RichardOnRails wrote:

[Rails] Changing names in an app -- advice wanted

2010-05-13 Thread RichardOnRails
Hi, I've got an app close to ready as version 1, but client wants labels on a form and corresponding column names in the database changed, e.g. the label/column named "purpose" to "description". I've got a form defined in app\views\expenses\new.html.erb with a field defined as: <%= f.label

[Rails] Re: Structuring Active Record relationships

2010-05-12 Thread RichardOnRails
or >   has_many :accounts > > class Account >   belongs_to :vendor >   has_many :expenses > > class Expense >   belongs_to :account > > Then when you have created an expense you can get its account through > @expense.account and its vendor through @expense.account.ve

[Rails] Re: Structuring Active Record relationships

2010-05-11 Thread RichardOnRails
record can get Accounts through Vendor. .. or something like that. Am I getting warmer? Thanks in Advance, Richard On May 11, 8:57 pm, RichardOnRails wrote: > Hi, > > I have three tables: Expenses, Vendors and Vendor _Accounts > > It should operate as follows: > When a new

[Rails] Structuring Active Record relationships

2010-05-11 Thread RichardOnRails
Hi, I have three tables: Expenses, Vendors and Vendor _Accounts It should operate as follows: When a new Expense record is created, A vendor is selected from a drop-down of Vendors and, An account is selected from a drop-down of Vendor_Accounts where Vendor_Accounts#vender == selected vendor So

[Rails] Using re to make BidDecimal's more readable using Regexp: problem

2010-05-08 Thread RichardOnRails
Hi, I'm on a mission to show my granddaughter how Pi can be computed. For that, I need Sqrt(2) computed accurately, which I've done. But I need to display results in 5-digit groups, space separated. The following aims at displaying the five-or-less decimal components of a 12-decimal-digit numbe

[Rails] Re: Installation prob. with authlogic-2.1.3 on Win-XP-Pro/SP3

2010-04-29 Thread RichardOnRails
I found an authlogic newsgroup: http://groups.google.com/group/authlogic. I cross-posted this question there. On Apr 29, 4:08 pm, RichardOnRails wrote: > Hi, > > I am following the instructions on >        http://github.com/binarylogic/authlogic_example#readme, >             sp

[Rails] Re: Installation prob. with authlogic-2.1.3 on Win-XP-Pro/SP3

2010-04-29 Thread RichardOnRails
Apr 29, 4:08 pm, RichardOnRails wrote: > Hi, > > I am following the instructions on >        http://github.com/binarylogic/authlogic_example#readme, >             specifically, the Tutorial "How to create this app ..." > section: > Step 1 of the tutorial contained three su

[Rails] Installation prob. with authlogic-2.1.3 on Win-XP-Pro/SP3

2010-04-29 Thread RichardOnRails
Hi, I am following the instructions on http://github.com/binarylogic/authlogic_example#readme, specifically, the Tutorial "How to create this app ..." section: Step 1 of the tutorial contained three sub-step which I identify here Step 1/a,b and c. The details of these steps and

[Rails] Re: Conditionally adding a link to a form -- how?

2010-04-28 Thread RichardOnRails
idance, Richard On Apr 28, 8:37 am, Marnen Laibow-Koser wrote: > RichardOnRails wrote: > > OK Marnen,  your hectoring has overcome me:  I got Git working with a > > local repository :-) > > Excellent!  If you don't mind one more tip: commit far more often than > you think is nec

  1   2   3   >