In another development tool I use, when I have a selection list that exceeds 20 or 30 items I usually create a button on the data entry form that takes me to a screen similar in form to Hobo's Index page. From there I can search for the record I am looking for and then click a button or link to select the record I want. The ID of the selected record is returned to the calling form and the link to the child is established.
It looks to me like that should be possible with something like a Table-Plus based form, but I have no clue how to set that up.
Can someone point me to an example of how something like this might be done?
You're talking about a form input that instead of a plain select, you can filter by name. You're probably looking for the <name-one /> tag. You'll need to setup an autocompleter to go along with it.
On Tuesday, May 1, 2012 10:22:30 AM UTC-6, jhstephenson wrote:
> In another development tool I use, when I have a selection list that > exceeds 20 or 30 items I usually create a button on the data entry form > that takes me to a screen similar in form to Hobo's Index page. From there > I can search for the record I am looking for and then click a button or > link to select the record I want. The ID of the selected record is returned > to the calling form and the link to the child is established.
> It looks to me like that should be possible with something like a > Table-Plus based form, but I have no clue how to set that up.
> Can someone point me to an example of how something like this might be > done?
I have am creating a new part purchased for a customer. It has the following fields:
Name (part description): Date: Customer: Quantity: etc....
When I get to the customer field, right now it is a drop down box listing all of my customers (or at least as many as are allowed to be displayed). I actually have over 200 possible customers to chose from, which I believe is too many for a drop down box, even if it was allowed.
I am not sure if this can be accomplished by what you are describing or not.
What I would like is the following:
Name (part description): Date: Customer: _______________ |Select| (Button or Link) Quantity: etc....
When the Select button is clicked I want to bring up a Table view with the folllowing on it:
Search ____________________________
Customer Address Contact
ABC Customer Any Address Some Contact |Select| (Button or Link) . |Select| (Button or Link) . |Select| (Button or Link) . |Select| (Button or Link) XYZ Customer Their Address Their Contact |Select| (Button or Link)
When selected it would return the Customer ID just like it had been chosen from a Drop down list.
I am not sure if that is what you are describing or not.
On Tuesday, May 1, 2012 12:45:06 PM UTC-6, kevinpfromnm wrote:
> You're talking about a form input that instead of a plain select, you can > filter by name. You're probably looking for the <name-one /> tag. You'll > need to setup an autocompleter to go along with it.
> On Tuesday, May 1, 2012 10:22:30 AM UTC-6, jhstephenson wrote:
>> In another development tool I use, when I have a selection list that >> exceeds 20 or 30 items I usually create a button on the data entry form >> that takes me to a screen similar in form to Hobo's Index page. From there >> I can search for the record I am looking for and then click a button or >> link to select the record I want. The ID of the selected record is returned >> to the calling form and the link to the child is established.
>> It looks to me like that should be possible with something like a >> Table-Plus based form, but I have no clue how to set that up.
>> Can someone point me to an example of how something like this might be >> done?
You're not going to get something like that out of the box. Something like a lightbox or other modal dialog to hold the table. The table will need to be ajax updated based on filters. Then you'll need a custom javascript to pass the selection back to the form.
Otherwise you'd need to store/pass along the form information for a standard page load somehow, then repopulate the form when you get back.
Seriously though, give the name-one a try. It's probably 80-90% towards what you're after functionality wise.
> When I get to the customer field, right now it is a drop down box listing > all of my customers (or at least as many as are allowed to be displayed). I > actually have over 200 possible customers to chose from, which I believe is > too many for a drop down box, even if it was allowed.
> I am not sure if this can be accomplished by what you are describing or > not.
> What I would like is the following:
> Name (part description): > Date: > Customer: _______________ |Select| (Button or Link) > Quantity: > etc....
> When the Select button is clicked I want to bring up a Table view with the > folllowing on it:
> Search ____________________________
> Customer Address Contact
> ABC Customer Any Address Some Contact > |Select| (Button or Link) > . > |Select| (Button or Link) > . > |Select| (Button or Link) > . > |Select| (Button or Link) > XYZ Customer Their Address Their Contact > |Select| (Button or Link)
> When selected it would return the Customer ID just like it had been chosen > from a Drop down list.
> I am not sure if that is what you are describing or not.
> Does that make sense?
> Jim
> On Tuesday, May 1, 2012 12:45:06 PM UTC-6, kevinpfromnm wrote:
>> You're talking about a form input that instead of a plain select, you can >> filter by name. You're probably looking for the <name-one /> tag. You'll >> need to setup an autocompleter to go along with it.
>> On Tuesday, May 1, 2012 10:22:30 AM UTC-6, jhstephenson wrote:
>>> In another development tool I use, when I have a selection list that >>> exceeds 20 or 30 items I usually create a button on the data entry form >>> that takes me to a screen similar in form to Hobo's Index page. From there >>> I can search for the record I am looking for and then click a button or >>> link to select the record I want. The ID of the selected record is returned >>> to the calling form and the link to the child is established.
>>> It looks to me like that should be possible with something like a >>> Table-Plus based form, but I have no clue how to set that up.
>>> Can someone point me to an example of how something like this might be >>> done?
On Tuesday, May 1, 2012 2:48:51 PM UTC-6, kevinpfromnm wrote:
> You're not going to get something like that out of the box. Something > like a lightbox or other modal dialog to hold the table. The table will > need to be ajax updated based on filters. Then you'll need a custom > javascript to pass the selection back to the form.
> Otherwise you'd need to store/pass along the form information for a > standard page load somehow, then repopulate the form when you get back.
> Seriously though, give the name-one a try. It's probably 80-90% towards > what you're after functionality wise.
> On Tuesday, May 1, 2012 2:17:31 PM UTC-6, jhstephenson wrote:
>> What I am looking for is something like this:
>> I have am creating a new part purchased for a customer. It has the >> following fields:
>> When I get to the customer field, right now it is a drop down box listing >> all of my customers (or at least as many as are allowed to be displayed). I >> actually have over 200 possible customers to chose from, which I believe is >> too many for a drop down box, even if it was allowed.
>> I am not sure if this can be accomplished by what you are describing or >> not.
>> What I would like is the following:
>> Name (part description): >> Date: >> Customer: _______________ |Select| (Button or Link) >> Quantity: >> etc....
>> When the Select button is clicked I want to bring up a Table view with >> the folllowing on it:
>> Search ____________________________
>> Customer Address Contact
>> ABC Customer Any Address Some Contact >> |Select| (Button or Link) >> . >> |Select| (Button or Link) >> . >> |Select| (Button or Link) >> . >> |Select| (Button or Link) >> XYZ Customer Their Address Their >> Contact |Select| (Button or Link)
>> When selected it would return the Customer ID just like it had been >> chosen from a Drop down list.
>> I am not sure if that is what you are describing or not.
>> Does that make sense?
>> Jim
>> On Tuesday, May 1, 2012 12:45:06 PM UTC-6, kevinpfromnm wrote:
>>> You're talking about a form input that instead of a plain select, you >>> can filter by name. You're probably looking for the <name-one /> tag. >>> You'll need to setup an autocompleter to go along with it.
>>> On Tuesday, May 1, 2012 10:22:30 AM UTC-6, jhstephenson wrote:
>>>> In another development tool I use, when I have a selection list that >>>> exceeds 20 or 30 items I usually create a button on the data entry form >>>> that takes me to a screen similar in form to Hobo's Index page. From there >>>> I can search for the record I am looking for and then click a button or >>>> link to select the record I want. The ID of the selected record is returned >>>> to the calling form and the link to the child is established.
>>>> It looks to me like that should be possible with something like a >>>> Table-Plus based form, but I have no clue how to set that up.
>>>> Can someone point me to an example of how something like this might be >>>> done?
> When I run it, I don't get anything different. I must have missed > something on how to use name-one.
> Jim
> On Tuesday, May 1, 2012 2:48:51 PM UTC-6, kevinpfromnm wrote:
>> You're not going to get something like that out of the box. Something >> like a lightbox or other modal dialog to hold the table. The table will >> need to be ajax updated based on filters. Then you'll need a custom >> javascript to pass the selection back to the form.
>> Otherwise you'd need to store/pass along the form information for a >> standard page load somehow, then repopulate the form when you get back.
>> Seriously though, give the name-one a try. It's probably 80-90% towards >> what you're after functionality wise.
>> On Tuesday, May 1, 2012 2:17:31 PM UTC-6, jhstephenson wrote:
>>> What I am looking for is something like this:
>>> I have am creating a new part purchased for a customer. It has the >>> following fields:
>>> When I get to the customer field, right now it is a drop down box >>> listing all of my customers (or at least as many as are allowed to be >>> displayed). I actually have over 200 possible customers to chose from, >>> which I believe is too many for a drop down box, even if it was allowed.
>>> I am not sure if this can be accomplished by what you are describing or >>> not.
>>> What I would like is the following:
>>> Name (part description): >>> Date: >>> Customer: _______________ |Select| (Button or Link) >>> Quantity: >>> etc....
>>> When the Select button is clicked I want to bring up a Table view with >>> the folllowing on it:
>>> Search ____________________________
>>> Customer Address Contact
>>> ABC Customer Any Address Some Contact >>> |Select| (Button or Link) >>> . >>> |Select| (Button or Link) >>> . >>> |Select| (Button or Link) >>> . >>> |Select| (Button or Link) >>> XYZ Customer Their Address Their >>> Contact |Select| (Button or Link)
>>> When selected it would return the Customer ID just like it had been >>> chosen from a Drop down list.
>>> I am not sure if that is what you are describing or not.
>>> Does that make sense?
>>> Jim
>>> On Tuesday, May 1, 2012 12:45:06 PM UTC-6, kevinpfromnm wrote:
>>>> You're talking about a form input that instead of a plain select, you >>>> can filter by name. You're probably looking for the <name-one /> tag. >>>> You'll need to setup an autocompleter to go along with it.
>>>> On Tuesday, May 1, 2012 10:22:30 AM UTC-6, jhstephenson wrote:
>>>>> In another development tool I use, when I have a selection list that >>>>> exceeds 20 or 30 items I usually create a button on the data entry form >>>>> that takes me to a screen similar in form to Hobo's Index page. From there >>>>> I can search for the record I am looking for and then click a button or >>>>> link to select the record I want. The ID of the selected record is returned >>>>> to the calling form and the link to the child is established.
>>>>> It looks to me like that should be possible with something like a >>>>> Table-Plus based form, but I have no clue how to set that up.
>>>>> Can someone point me to an example of how something like this might be >>>>> done?
>> When I run it, I don't get anything different. I must have missed >> something on how to use name-one.
>> Jim
>> On Tuesday, May 1, 2012 2:48:51 PM UTC-6, kevinpfromnm wrote:
>>> You're not going to get something like that out of the box. Something >>> like a lightbox or other modal dialog to hold the table. The table will >>> need to be ajax updated based on filters. Then you'll need a custom >>> javascript to pass the selection back to the form.
>>> Otherwise you'd need to store/pass along the form information for a >>> standard page load somehow, then repopulate the form when you get back.
>>> Seriously though, give the name-one a try. It's probably 80-90% towards >>> what you're after functionality wise.
>>> On Tuesday, May 1, 2012 2:17:31 PM UTC-6, jhstephenson wrote:
>>>> What I am looking for is something like this:
>>>> I have am creating a new part purchased for a customer. It has the >>>> following fields:
>>>> When I get to the customer field, right now it is a drop down box >>>> listing all of my customers (or at least as many as are allowed to be >>>> displayed). I actually have over 200 possible customers to chose from, >>>> which I believe is too many for a drop down box, even if it was allowed.
>>>> I am not sure if this can be accomplished by what you are describing or >>>> not.
>>>> What I would like is the following:
>>>> Name (part description): >>>> Date: >>>> Customer: _______________ |Select| (Button or Link) >>>> Quantity: >>>> etc....
>>>> When the Select button is clicked I want to bring up a Table view with >>>> the folllowing on it:
>>>> Search ____________________________
>>>> Customer Address Contact
>>>> ABC Customer Any Address Some Contact >>>> |Select| (Button or Link) >>>> . >>>> |Select| (Button or Link) >>>> . >>>> |Select| (Button or Link) >>>> . >>>> |Select| (Button or Link) >>>> XYZ Customer Their Address Their >>>> Contact |Select| (Button or Link)
>>>> When selected it would return the Customer ID just like it had been >>>> chosen from a Drop down list.
>>>> I am not sure if that is what you are describing or not.
>>>> Does that make sense?
>>>> Jim
>>>> On Tuesday, May 1, 2012 12:45:06 PM UTC-6, kevinpfromnm wrote:
>>>>> You're talking about a form input that instead of a plain select, you >>>>> can filter by name. You're probably looking for the <name-one /> tag. >>>>> You'll need to setup an autocompleter to go along with it.
>>>>> On Tuesday, May 1, 2012 10:22:30 AM UTC-6, jhstephenson wrote:
>>>>>> In another development tool I use, when I have a selection list that >>>>>> exceeds 20 or 30 items I usually create a button on the data entry form >>>>>> that takes me to a screen similar in form to Hobo's Index page. From there >>>>>> I can search for the record I am looking for and then click a button or >>>>>> link to select the record I want. The ID of the selected record is returned >>>>>> to the calling form and the link to the child is established.
>>>>>> It looks to me like that should be possible with something like a >>>>>> Table-Plus based form, but I have no clue how to set that up.
>>>>>> Can someone point me to an example of how something like this might >>>>>> be done?
It looks like an "edit field", because name-one is indeed an input
field where you can type. The trick is: you start typing the name of a
client, and then you are given a list to select from, just like when
you are start typing in Google and Google suggests some possible words.
If it doesn't work you can monitor the Ajax calls in several ways. For
example, you can look at the log or use Firebug's network tab.
> When I run it, I don't get anything different. I must have missed
> something on how to use name-one.
> Jim
> On Tuesday, May 1, 2012 2:48:51 PM UTC-6, kevinpfromnm wrote:
> You're not going to get something like that out of the box. > Something like a lightbox or other modal dialog to hold the table.
> The table will need to be ajax updated based on filters. Then
> you'll need a custom javascript to pass the selection back to the
> form.
> Otherwise you'd need to store/pass along the form information for a
> standard page load somehow, then repopulate the form when you get
> back.
> Seriously though, give the name-one a try. It's probably 80-90%
> towards what you're after functionality wise.
> On Tuesday, May 1, 2012 2:17:31 PM UTC-6, jhstephenson wrote:
> What I am looking for is something like this:
> I have am creating a new part purchased for a customer. It has the
> following fields:
> Name (part description): Date: Customer: Quantity: etc....
> When I get to the customer field, right now it is a drop down box
> listing all of my customers (or at least as many as are allowed to
> be displayed). I actually have over 200 possible customers to chose
> from, which I believe is too many for a drop down box, even if it
> was allowed.
> I am not sure if this can be accomplished by what you are
> describing or not.
> What I would like is the following:
> Name (part description): Date: Customer: _______________ |Select|
> (Button or Link) Quantity: etc....
> When the Select button is clicked I want to bring up a Table view
> with the folllowing on it:
> Search ____________________________
> Customer Address Contact
> ABC Customer Any Address Some Contact |Select|
> (Button or Link) .
> |Select| (Button or Link) .
> |Select| (Button or Link) .
> |Select| (Button or Link) XYZ Customer Their Address
> Their Contact |Select| (Button or Link)
> When selected it would return the Customer ID just like it had been
> chosen from a Drop down list.
> I am not sure if that is what you are describing or not.
> Does that make sense?
> Jim
> On Tuesday, May 1, 2012 12:45:06 PM UTC-6, kevinpfromnm wrote:
> You're talking about a form input that instead of a plain select,
> you can filter by name. You're probably looking for the <name-one
> /> tag. You'll need to setup an autocompleter to go along with
> it.
> On Tuesday, May 1, 2012 10:22:30 AM UTC-6, jhstephenson wrote:
> In another development tool I use, when I have a selection list
> that exceeds 20 or 30 items I usually create a button on the data
> entry form that takes me to a screen similar in form to Hobo's
> Index page. From there I can search for the record I am looking for
> and then click a button or link to select the record I want. The ID
> of the selected record is returned to the calling form and the link
> to the child is established.
> It looks to me like that should be possible with something like a
> Table-Plus based form, but I have no clue how to set that up.
> Can someone point me to an example of how something like this might
> be done?
> Thanks, Jim
> -- You received this message because you are subscribed to the
> Google Groups "Hobo Users" group. To view this discussion on the
> web visit > https://groups.google.com/d/msg/hobousers/-/_uq48N2YymoJ. To post
> to this group, send email to hobousers@googlegroups.com. To
> unsubscribe from this group, send email to > hobousers+unsubscribe@googlegroups.com. For more options, visit
> this group at http://groups.google.com/group/hobousers?hl=en.
- -- Ignacio Huerta Arteche
http://www.ihuerta.net Tel fono: 0034 645 70 77 35
Email realizado con software libre
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
I assume the key entry here is the one indicating that ActiveRecord could not fine the Category with ID=complete_name.
Should there be a method in the Category controller called complete_name?
On Tuesday, May 1, 2012 10:22:30 AM UTC-6, jhstephenson wrote:
> In another development tool I use, when I have a selection list that > exceeds 20 or 30 items I usually create a button on the data entry form > that takes me to a screen similar in form to Hobo's Index page. From there > I can search for the record I am looking for and then click a button or > link to select the record I want. The ID of the selected record is returned > to the calling form and the link to the child is established.
> It looks to me like that should be possible with something like a > Table-Plus based form, but I have no clue how to set that up.
> Can someone point me to an example of how something like this might be > done?
> I assume the key entry here is the one indicating that ActiveRecord could not fine the Category with ID=complete_name.
> Should there be a method in the Category controller called complete_name?
Yep. The quickest way to get one is with the autocomplete method:
That will give me what I want. On thing I notice is that the search result brings up anything found with the matching characters, not just something that starts with what I type. I actually like that better than what I planned, but if I wanted to limit it to just the starting characters of a name field, is there a way to filter it that way?
> > I assume the key entry here is the one indicating that ActiveRecord > could not fine the Category with ID=complete_name. > > Should there be a method in the Category controller called > complete_name?
> Yep. The quickest way to get one is with the autocomplete method:
The autocompleter provides a default finder which you could override to only return results starting with your match. You might want to do that for performance reasons as matching text anywhere in a string is much more expensive than matching the beginning (of an indexed column).
On Friday, May 4, 2012 1:23:30 PM UTC-6, jhstephenson wrote:
> Thanks,
> That will give me what I want. On thing I notice is that the search result > brings up anything found with the matching characters, not just something > that starts with what I type. I actually like that better than what I > planned, but if I wanted to limit it to just the starting characters of a > name field, is there a way to filter it that way?
> Jim
> On Friday, May 4, 2012 5:56:46 AM UTC-6, Matt jones wrote:
>> On May 3, 2012, at 9:22 PM, jhstephenson wrote:
>> > Ok. Here is what the log shows when I try do it on just my Category >> field:
>> > Started GET "/categories/complete_name?query=Computer" for 127.0.0.1 at >> 2012-05-03 19:18:24 -0600 >> > [1m [36mSQL (2.0ms) [0m [1mSHOW TABLES [0m >> > [1m [35mSQL (1.0ms) [0m SHOW TABLES >> > [1m [36mSQL (2.0ms) [0m [1mSHOW TABLES [0m >> > [1m [35mSQL (1.0ms) [0m SHOW TABLES >> > [1m [36mSQL (1.0ms) [0m [1mSHOW TABLES [0m >> > [1m [35mSQL (2.0ms) [0m SHOW TABLES >> > [1m [36mSQL (2.0ms) [0m [1mSHOW TABLES [0m >> > Processing by CategoriesController#show as JS >> > Parameters: {"query"=>"Computer", "id"=>"complete_name"} >> > [1m [35mSQL (1.0ms) [0m SELECT COUNT(*) AS count_id FROM `users` >> > [1m [36mUser Load (1.0ms) [0m [1mSELECT `users`.* FROM `users` WHERE >> (`users`.`id` = 1) LIMIT 1 [0m >> > [1m [35mCategory Load (0.0ms) [0m SELECT `categories`.* FROM >> `categories` WHERE (`categories`.`id` = 0) LIMIT 1 >> > Completed in 20ms
>> > ActiveRecord::RecordNotFound (Couldn't find Category with >> ID=complete_name):
>> > I assume the key entry here is the one indicating that ActiveRecord >> could not fine the Category with ID=complete_name. >> > Should there be a method in the Category controller called >> complete_name?
>> Yep. The quickest way to get one is with the autocomplete method:
On Friday, May 4, 2012 2:30:31 PM UTC-6, kevinpfromnm wrote:
> The autocompleter provides a default finder which you could override to > only return results starting with your match. You might want to do that > for performance reasons as matching text anywhere in a string is much more > expensive than matching the beginning (of an indexed column).
> On Friday, May 4, 2012 1:23:30 PM UTC-6, jhstephenson wrote:
>> Thanks,
>> That will give me what I want. On thing I notice is that the search >> result brings up anything found with the matching characters, not just >> something that starts with what I type. I actually like that better than >> what I planned, but if I wanted to limit it to just the starting characters >> of a name field, is there a way to filter it that way?
>> Jim
>> On Friday, May 4, 2012 5:56:46 AM UTC-6, Matt jones wrote:
>>> On May 3, 2012, at 9:22 PM, jhstephenson wrote:
>>> > Ok. Here is what the log shows when I try do it on just my Category >>> field:
>>> > Started GET "/categories/complete_name?query=Computer" for 127.0.0.1 >>> at 2012-05-03 19:18:24 -0600 >>> > [1m [36mSQL (2.0ms) [0m [1mSHOW TABLES [0m >>> > [1m [35mSQL (1.0ms) [0m SHOW TABLES >>> > [1m [36mSQL (2.0ms) [0m [1mSHOW TABLES [0m >>> > [1m [35mSQL (1.0ms) [0m SHOW TABLES >>> > [1m [36mSQL (1.0ms) [0m [1mSHOW TABLES [0m >>> > [1m [35mSQL (2.0ms) [0m SHOW TABLES >>> > [1m [36mSQL (2.0ms) [0m [1mSHOW TABLES [0m >>> > Processing by CategoriesController#show as JS >>> > Parameters: {"query"=>"Computer", "id"=>"complete_name"} >>> > [1m [35mSQL (1.0ms) [0m SELECT COUNT(*) AS count_id FROM `users` >>> > [1m [36mUser Load (1.0ms) [0m [1mSELECT `users`.* FROM `users` >>> WHERE (`users`.`id` = 1) LIMIT 1 [0m >>> > [1m [35mCategory Load (0.0ms) [0m SELECT `categories`.* FROM >>> `categories` WHERE (`categories`.`id` = 0) LIMIT 1 >>> > Completed in 20ms
>>> > ActiveRecord::RecordNotFound (Couldn't find Category with >>> ID=complete_name):
>>> > I assume the key entry here is the one indicating that ActiveRecord >>> could not fine the Category with ID=complete_name. >>> > Should there be a method in the Category controller called >>> complete_name?
>>> Yep. The quickest way to get one is with the autocomplete method:
On Friday, May 4, 2012 2:30:31 PM UTC-6, kevinpfromnm wrote:
> The autocompleter provides a default finder which you could override to > only return results starting with your match. You might want to do that > for performance reasons as matching text anywhere in a string is much more > expensive than matching the beginning (of an indexed column).
> On Friday, May 4, 2012 1:23:30 PM UTC-6, jhstephenson wrote:
>> Thanks,
>> That will give me what I want. On thing I notice is that the search >> result brings up anything found with the matching characters, not just >> something that starts with what I type. I actually like that better than >> what I planned, but if I wanted to limit it to just the starting characters >> of a name field, is there a way to filter it that way?
>> Jim
>> On Friday, May 4, 2012 5:56:46 AM UTC-6, Matt jones wrote:
>>> On May 3, 2012, at 9:22 PM, jhstephenson wrote:
>>> > Ok. Here is what the log shows when I try do it on just my Category >>> field:
>>> > Started GET "/categories/complete_name?query=Computer" for 127.0.0.1 >>> at 2012-05-03 19:18:24 -0600 >>> > [1m [36mSQL (2.0ms) [0m [1mSHOW TABLES [0m >>> > [1m [35mSQL (1.0ms) [0m SHOW TABLES >>> > [1m [36mSQL (2.0ms) [0m [1mSHOW TABLES [0m >>> > [1m [35mSQL (1.0ms) [0m SHOW TABLES >>> > [1m [36mSQL (1.0ms) [0m [1mSHOW TABLES [0m >>> > [1m [35mSQL (2.0ms) [0m SHOW TABLES >>> > [1m [36mSQL (2.0ms) [0m [1mSHOW TABLES [0m >>> > Processing by CategoriesController#show as JS >>> > Parameters: {"query"=>"Computer", "id"=>"complete_name"} >>> > [1m [35mSQL (1.0ms) [0m SELECT COUNT(*) AS count_id FROM `users` >>> > [1m [36mUser Load (1.0ms) [0m [1mSELECT `users`.* FROM `users` >>> WHERE (`users`.`id` = 1) LIMIT 1 [0m >>> > [1m [35mCategory Load (0.0ms) [0m SELECT `categories`.* FROM >>> `categories` WHERE (`categories`.`id` = 0) LIMIT 1 >>> > Completed in 20ms
>>> > ActiveRecord::RecordNotFound (Couldn't find Category with >>> ID=complete_name):
>>> > I assume the key entry here is the one indicating that ActiveRecord >>> could not fine the Category with ID=complete_name. >>> > Should there be a method in the Category controller called >>> complete_name?
>>> Yep. The quickest way to get one is with the autocomplete method:
On Friday, May 4, 2012 2:33:21 PM UTC-6, kevinpfromnm wrote:
> Oh, there's a parameter in autocompleter to specify a different > query_scope from default now (as opposed to using a finder).
> On Friday, May 4, 2012 2:30:31 PM UTC-6, kevinpfromnm wrote:
>> The autocompleter provides a default finder which you could override to >> only return results starting with your match. You might want to do that >> for performance reasons as matching text anywhere in a string is much more >> expensive than matching the beginning (of an indexed column).
>> On Friday, May 4, 2012 1:23:30 PM UTC-6, jhstephenson wrote:
>>> Thanks,
>>> That will give me what I want. On thing I notice is that the search >>> result brings up anything found with the matching characters, not just >>> something that starts with what I type. I actually like that better than >>> what I planned, but if I wanted to limit it to just the starting characters >>> of a name field, is there a way to filter it that way?
>>> Jim
>>> On Friday, May 4, 2012 5:56:46 AM UTC-6, Matt jones wrote:
>>>> On May 3, 2012, at 9:22 PM, jhstephenson wrote:
>>>> > Ok. Here is what the log shows when I try do it on just my Category >>>> field:
>>>> > Started GET "/categories/complete_name?query=Computer" for 127.0.0.1 >>>> at 2012-05-03 19:18:24 -0600 >>>> > [1m [36mSQL (2.0ms) [0m [1mSHOW TABLES [0m >>>> > [1m [35mSQL (1.0ms) [0m SHOW TABLES >>>> > [1m [36mSQL (2.0ms) [0m [1mSHOW TABLES [0m >>>> > [1m [35mSQL (1.0ms) [0m SHOW TABLES >>>> > [1m [36mSQL (1.0ms) [0m [1mSHOW TABLES [0m >>>> > [1m [35mSQL (2.0ms) [0m SHOW TABLES >>>> > [1m [36mSQL (2.0ms) [0m [1mSHOW TABLES [0m >>>> > Processing by CategoriesController#show as JS >>>> > Parameters: {"query"=>"Computer", "id"=>"complete_name"} >>>> > [1m [35mSQL (1.0ms) [0m SELECT COUNT(*) AS count_id FROM `users` >>>> > [1m [36mUser Load (1.0ms) [0m [1mSELECT `users`.* FROM `users` >>>> WHERE (`users`.`id` = 1) LIMIT 1 [0m >>>> > [1m [35mCategory Load (0.0ms) [0m SELECT `categories`.* FROM >>>> `categories` WHERE (`categories`.`id` = 0) LIMIT 1 >>>> > Completed in 20ms
>>>> > ActiveRecord::RecordNotFound (Couldn't find Category with >>>> ID=complete_name):
>>>> > I assume the key entry here is the one indicating that ActiveRecord >>>> could not fine the Category with ID=complete_name. >>>> > Should there be a method in the Category controller called >>>> complete_name?
>>>> Yep. The quickest way to get one is with the autocomplete method:
> On Friday, May 4, 2012 2:30:31 PM UTC-6, kevinpfromnm wrote:
>> The autocompleter provides a default finder which you could override to >> only return results starting with your match. You might want to do that >> for performance reasons as matching text anywhere in a string is much more >> expensive than matching the beginning (of an indexed column).
>> On Friday, May 4, 2012 1:23:30 PM UTC-6, jhstephenson wrote:
>>> Thanks,
>>> That will give me what I want. On thing I notice is that the search >>> result brings up anything found with the matching characters, not just >>> something that starts with what I type. I actually like that better than >>> what I planned, but if I wanted to limit it to just the starting characters >>> of a name field, is there a way to filter it that way?
>>> Jim
>>> On Friday, May 4, 2012 5:56:46 AM UTC-6, Matt jones wrote:
>>>> On May 3, 2012, at 9:22 PM, jhstephenson wrote:
>>>> > Ok. Here is what the log shows when I try do it on just my Category >>>> field:
>>>> > Started GET "/categories/complete_name?query=Computer" for 127.0.0.1 >>>> at 2012-05-03 19:18:24 -0600 >>>> > [1m [36mSQL (2.0ms) [0m [1mSHOW TABLES [0m >>>> > [1m [35mSQL (1.0ms) [0m SHOW TABLES >>>> > [1m [36mSQL (2.0ms) [0m [1mSHOW TABLES [0m >>>> > [1m [35mSQL (1.0ms) [0m SHOW TABLES >>>> > [1m [36mSQL (1.0ms) [0m [1mSHOW TABLES [0m >>>> > [1m [35mSQL (2.0ms) [0m SHOW TABLES >>>> > [1m [36mSQL (2.0ms) [0m [1mSHOW TABLES [0m >>>> > Processing by CategoriesController#show as JS >>>> > Parameters: {"query"=>"Computer", "id"=>"complete_name"} >>>> > [1m [35mSQL (1.0ms) [0m SELECT COUNT(*) AS count_id FROM `users` >>>> > [1m [36mUser Load (1.0ms) [0m [1mSELECT `users`.* FROM `users` >>>> WHERE (`users`.`id` = 1) LIMIT 1 [0m >>>> > [1m [35mCategory Load (0.0ms) [0m SELECT `categories`.* FROM >>>> `categories` WHERE (`categories`.`id` = 0) LIMIT 1 >>>> > Completed in 20ms
>>>> > ActiveRecord::RecordNotFound (Couldn't find Category with >>>> ID=complete_name):
>>>> > I assume the key entry here is the one indicating that ActiveRecord >>>> could not fine the Category with ID=complete_name. >>>> > Should there be a method in the Category controller called >>>> complete_name?
>>>> Yep. The quickest way to get one is with the autocomplete method:
On Friday, May 4, 2012 3:47:21 PM UTC-6, jhstephenson wrote:
> Thanks,
> I just have to learn more about scopes now. I wish there were more > examples for things like this.
> Jim
> On Friday, May 4, 2012 2:33:21 PM UTC-6, kevinpfromnm wrote:
>> Oh, there's a parameter in autocompleter to specify a different >> query_scope from default now (as opposed to using a finder).
>> On Friday, May 4, 2012 2:30:31 PM UTC-6, kevinpfromnm wrote:
>>> The autocompleter provides a default finder which you could override to >>> only return results starting with your match. You might want to do that >>> for performance reasons as matching text anywhere in a string is much more >>> expensive than matching the beginning (of an indexed column).
>>> On Friday, May 4, 2012 1:23:30 PM UTC-6, jhstephenson wrote:
>>>> Thanks,
>>>> That will give me what I want. On thing I notice is that the search >>>> result brings up anything found with the matching characters, not just >>>> something that starts with what I type. I actually like that better than >>>> what I planned, but if I wanted to limit it to just the starting characters >>>> of a name field, is there a way to filter it that way?
>>>> Jim
>>>> On Friday, May 4, 2012 5:56:46 AM UTC-6, Matt jones wrote:
>>>>> On May 3, 2012, at 9:22 PM, jhstephenson wrote:
>>>>> > Ok. Here is what the log shows when I try do it on just my Category >>>>> field:
>>>>> > Started GET "/categories/complete_name?query=Computer" for 127.0.0.1 >>>>> at 2012-05-03 19:18:24 -0600 >>>>> > [1m [36mSQL (2.0ms) [0m [1mSHOW TABLES [0m >>>>> > [1m [35mSQL (1.0ms) [0m SHOW TABLES >>>>> > [1m [36mSQL (2.0ms) [0m [1mSHOW TABLES [0m >>>>> > [1m [35mSQL (1.0ms) [0m SHOW TABLES >>>>> > [1m [36mSQL (1.0ms) [0m [1mSHOW TABLES [0m >>>>> > [1m [35mSQL (2.0ms) [0m SHOW TABLES >>>>> > [1m [36mSQL (2.0ms) [0m [1mSHOW TABLES [0m >>>>> > Processing by CategoriesController#show as JS >>>>> > Parameters: {"query"=>"Computer", "id"=>"complete_name"} >>>>> > [1m [35mSQL (1.0ms) [0m SELECT COUNT(*) AS count_id FROM `users` >>>>> > [1m [36mUser Load (1.0ms) [0m [1mSELECT `users`.* FROM `users` >>>>> WHERE (`users`.`id` = 1) LIMIT 1 [0m >>>>> > [1m [35mCategory Load (0.0ms) [0m SELECT `categories`.* FROM >>>>> `categories` WHERE (`categories`.`id` = 0) LIMIT 1 >>>>> > Completed in 20ms
>>>>> > ActiveRecord::RecordNotFound (Couldn't find Category with >>>>> ID=complete_name):
>>>>> > I assume the key entry here is the one indicating that ActiveRecord >>>>> could not fine the Category with ID=complete_name. >>>>> > Should there be a method in the Category controller called >>>>> complete_name?
>>>>> Yep. The quickest way to get one is with the autocomplete method:
>> On Friday, May 4, 2012 2:30:31 PM UTC-6, kevinpfromnm wrote:
>>> The autocompleter provides a default finder which you could override to >>> only return results starting with your match. You might want to do that >>> for performance reasons as matching text anywhere in a string is much more >>> expensive than matching the beginning (of an indexed column).
>>> On Friday, May 4, 2012 1:23:30 PM UTC-6, jhstephenson wrote:
>>>> Thanks,
>>>> That will give me what I want. On thing I notice is that the search >>>> result brings up anything found with the matching characters, not just >>>> something that starts with what I type. I actually like that better than >>>> what I planned, but if I wanted to limit it to just the starting characters >>>> of a name field, is there a way to filter it that way?
>>>> Jim
>>>> On Friday, May 4, 2012 5:56:46 AM UTC-6, Matt jones wrote:
>>>>> On May 3, 2012, at 9:22 PM, jhstephenson wrote:
>>>>> > Ok. Here is what the log shows when I try do it on just my Category >>>>> field:
>>>>> > Started GET "/categories/complete_name?query=Computer" for 127.0.0.1 >>>>> at 2012-05-03 19:18:24 -0600 >>>>> > [1m [36mSQL (2.0ms) [0m [1mSHOW TABLES [0m >>>>> > [1m [35mSQL (1.0ms) [0m SHOW TABLES >>>>> > [1m [36mSQL (2.0ms) [0m [1mSHOW TABLES [0m >>>>> > [1m [35mSQL (1.0ms) [0m SHOW TABLES >>>>> > [1m [36mSQL (1.0ms) [0m [1mSHOW TABLES [0m >>>>> > [1m [35mSQL (2.0ms) [0m SHOW TABLES >>>>> > [1m [36mSQL (2.0ms) [0m [1mSHOW TABLES [0m >>>>> > Processing by CategoriesController#show as JS >>>>> > Parameters: {"query"=>"Computer", "id"=>"complete_name"} >>>>> > [1m [35mSQL (1.0ms) [0m SELECT COUNT(*) AS count_id FROM `users` >>>>> > [1m [36mUser Load (1.0ms) [0m [1mSELECT `users`.* FROM `users` >>>>> WHERE (`users`.`id` = 1) LIMIT 1 [0m >>>>> > [1m [35mCategory Load (0.0ms) [0m SELECT `categories`.* FROM >>>>> `categories` WHERE (`categories`.`id` = 0) LIMIT 1 >>>>> > Completed in 20ms
>>>>> > ActiveRecord::RecordNotFound (Couldn't find Category with >>>>> ID=complete_name):
>>>>> > I assume the key entry here is the one indicating that ActiveRecord >>>>> could not fine the Category with ID=complete_name. >>>>> > Should there be a method in the Category controller called >>>>> complete_name?
>>>>> Yep. The quickest way to get one is with the autocomplete method: