Re: [Rails] updating records

2018-08-27 Thread Joe Guerra
Great, I've got my new scope in there. Seems to be working well. I've got to learn how to write tests. :) On Sunday, August 26, 2018 at 12:52:29 PM UTC-4, Colin Law wrote: > > On Sun, 26 Aug 2018 at 17:20, Joe Guerra > wrote: > > > > Yes, I know. > > > > I learned about using the default sc

Re: [Rails] updating records

2018-08-26 Thread Colin Law
On Sun, 26 Aug 2018 at 17:20, Joe Guerra wrote: > > Yes, I know. > > I learned about using the default scope, then put it into my app. Then I > discovered everyone said not to use them. lol. Yes, default scope seems like a good idea initially, but it often end with tears :( Colin > > > > On

Re: [Rails] updating records

2018-08-26 Thread Joe Guerra
Yes, I know. I learned about using the default scope, then put it into my app. Then I discovered everyone said not to use them. lol. On Wednesday, August 22, 2018 at 8:08:53 PM UTC-4, Walter Lee Davis wrote: > > > > On Aug 22, 2018, at 1:28 PM, Joe Guerra > wrote: > > > > I've got to fi

Re: [Rails] updating records

2018-08-22 Thread Walter Lee Davis
> On Aug 22, 2018, at 1:28 PM, Joe Guerra wrote: > > I've got to fix my default scope. Default scopes are a serious anti-pattern, and cause more pain than they solve. I cannot think of one time I used them that I didn't regret it later. Walter > > On Wed, Aug 22, 2018 at 1:23 PM, Joe Guerr

Re: [Rails] updating records

2018-08-22 Thread Joe Guerra
I've got to fix my default scope. On Wed, Aug 22, 2018 at 1:23 PM, Joe Guerra wrote: > ok, so I got it working... > > the process is add to cart my show page updates quantity... and if > it reached 0 now i've got it updating and redirecting to root_path. > > works like a charm. (not sure

Re: [Rails] updating records

2018-08-22 Thread Joe Guerra
ok, so I got it working... the process is add to cart my show page updates quantity... and if it reached 0 now i've got it updating and redirecting to root_path. works like a charm. (not sure if that's optimal). On Wednesday, August 22, 2018 at 12:34:02 PM UTC-4, Colin Law wrote: > > On

Re: [Rails] updating records

2018-08-22 Thread Colin Law
On Wed, 22 Aug 2018 at 17:17, Joe Guerra wrote: > > Yes, in the product controller? > > In > Def show > End That is not a page that is a controller action, which invokes a view. It is important to use the correct words or others will not know what you mean. By page I assumed you meant the view.

Re: [Rails] updating records

2018-08-22 Thread Joe Guerra
Yes, in the product controller? In Def show End On Wed, Aug 22, 2018, 12:00 PM Colin Law, wrote: > On Wed, 22 Aug 2018 at 16:54, Joe Guerra wrote: > > > > Ok, since it's on the show page I can check for that (and it did work on > that page), but as soon as it is added I think I need to redirec

Re: [Rails] updating records

2018-08-22 Thread Colin Law
On Wed, 22 Aug 2018 at 16:54, Joe Guerra wrote: > > Ok, since it's on the show page I can check for that (and it did work on that > page), but as soon as it is added I think I need to redirect to another page, You shouldn't be doing it in a view at all, you should do it in the action or model th

Re: [Rails] updating records

2018-08-22 Thread Joe Guerra
Ok, since it's on the show page I can check for that (and it did work on that page), but as soon as it is added I think I need to redirect to another page, (because I don't display items that are fully funded and i got a page not found message 404)... I'll try it soon. Some sort of congratula

Re: [Rails] updating records

2018-08-22 Thread Colin Law
On Wed, 22 Aug 2018 at 16:31, Joe Guerra wrote: > > ok, well I need to flip a few boolean values to begin the group order process. Oh, you mean that when the amount goes to zero you need to take some action? In that case that should probably be initiated by the action that sets it zero, either d

Re: [Rails] updating records

2018-08-22 Thread Joe Guerra
ok, well I need to flip a few boolean values to begin the group order process. On Wed, Aug 22, 2018 at 11:22 AM, Colin Law wrote: > On Wed, 22 Aug 2018 at 15:36, Joe Guerra wrote: > > > > > > I know how to update records, but not sure where I should put my code > when product qty == 0. > > I

Re: [Rails] updating records

2018-08-22 Thread Colin Law
On Wed, 22 Aug 2018 at 15:36, Joe Guerra wrote: > > > I know how to update records, but not sure where I should put my code when > product qty == 0. > I do have a flash notice on the show page that displays a message when the > last item is left. > > Should I put update the records on the show

[Rails] updating records

2018-08-22 Thread Joe Guerra
I know how to update records, but not sure where I should put my code when product qty == 0. I do have a flash notice on the show page that displays a message when the last item is left. Should I put update the records on the show page as well ? (when qty == 0 ) Thanks, Joe -- You rece

Re: [Rails] Updating records

2010-03-29 Thread Colin Law
On 29 March 2010 19:00, Stephen None wrote: > So I would like to be able to update a record without having to load the > edit page.  Lets use checking out a book as an example.  From the front > page of my application I would like to be able to have a form field > where I can enter a record id and

[Rails] Updating records

2010-03-29 Thread Stephen None
So I would like to be able to update a record without having to load the edit page. Lets use checking out a book as an example. From the front page of my application I would like to be able to have a form field where I can enter a record id and select one of a couple of check boxes and then hit s