Hi Ibon,

I haven't found a DRYML tag for the rendering. What I have found is the 
hobo_completions def in lib/hobo/controller/model.rb.

    def hobo_completions(attribute, finder, options={})
      options = options.reverse_merge(:limit => 10, :query_scope => 
"#{attribute}_contains")
      options[:param] ||= [:term, :q, :query].find{|k| !params[k].nil?}
      finder = finder.limit(options[:limit]) unless finder.try.limit_value

      begin
        finder = finder.send(options[:query_scope], params[options[:param]])
        items = finder.find(:all).select { |r| r.viewable_by?(current_user) 
}
      rescue TypeError  # must be a list of methods instead
        items = []
        options[:query_scope].each do |qscope|
          finder2 = finder.send(qscope, params[options[:param]])
          items += finder2.find(:all).select { |r| 
r.viewable_by?(current_user) }
        end
      end
      if request.xhr?
        if options[:param] == :q
          render :json => items.map {|i| {:id => 
"@#{i.send(i.class.primary_key)}", :name => i.send(attribute)}}
        else
          *render :json => items.map {|i| i.send(attribute)}*
        end
      else
        render :text => "<ul>\n" + items.map {|i| 
"<li>#{i.send(attribute)}</li>\n"}.join + "</ul>"
      end
    end


options[:param] == :term in my case. So, the bolded line should be the 
responder which does match with what Charles captured as the server 
response. I would think that there isn't a DRYML tag associated with that 
render line. But, obviously something is handling it. 

*Interesting! I decided to check one more thing before sending this note. I 
was using the <name-one> tag which is should be just a wrapper for 
<name-one-jquery-ui>. Apparently it's different. All is working as expected 
now that I'm using <name-one-jquery-ui>.*

Thank you very much for your help Ibon!

Paul

On Thursday, November 5, 2015 at 3:17:54 AM UTC-8, Ibon Castilla wrote:
>
> -----BEGIN PGP SIGNED MESSAGE----- 
> Hash: SHA1 
>
> Hi Paul, 
>
> Looking at the results of your server response I guess that the deal 
> in this case will be at the DRYML responsible of rendering the "ul" 
> tag. Maybe there is a limitation of 8 items in there so the tag 
> ignores the remaining data coming from the server. Have you tried to 
> locate the DRYML tag regarding this issue?. 
>
> Regards, Ibon. 
>
> Abrazo, Ibon. 
>
> Usa Software Libre, tus úlceras te lo agradecerán 
> Realizado con Software Libre. 
> - -- 
> GPG public key at http://sinanimodelucro.net/ibon_gmail.asc 
> Finderprint: 1761 59B9 6DE6 0402 31B9 1872 178F A6FD 75F9 EB29 
>
> El 05/11/15 a las 02:32, Paul escribió: 
> > Hi, 
> > 
> > I'm using hobo 2.0.1 with rails 3.2.21 on ruby 1.9.3. 
> > 
> > I've been working with the <name-one> tag which is pretty cool, but 
> > I'm only able to display 8 rows of results. I can change the limit 
> > on hobo_completions and using charles to observe the traffic, I see 
> > that the response is including the number I set. But the list in 
> > the browser display stops at 8. I've inspected the resulting <ul> 
> > element and it only contains the 8 rows. 
> > 
> > Any idea of how I can get it to display all the results? 
> > 
> > Thanks for you help! 
> > 
> > Paul 
> > 
> > From my controller: 
> > 
> > autocomplete :item_code do hobo_completions :item_code, 
> > Item.user_where(current_user), {limit: 30} end 
> > 
> > 
> > From the resulting page: 
> > 
> > <ul class="typeahead dropdown-menu" style="top: 306.267px; left: 
> > 170px; display: none;"> <li data-value="NW12CSVPSTPCSCRARCIPR - 
> > 2012 Cabernet Sauvignon" class=""><a 
> > href="#"><strong>NW</strong>12CSVPSTPCSCRARCIPR - 2012 Cabernet 
> > Sauvignon</a></li> <li data-value="NW12MLOPSTPCSCRARCIPR - 2012 
> > Merlot"><a href="#"><strong>NW</strong>12MLOPSTPCSCRARCIPR - 2012 
> > Merlot</a></li> <li data-value="NW12PSYPSTPCSCRARCIPR - 2012 Petite 
> > Sirah"><a href="#"><strong>NW</strong>12PSYPSTPCSCRARCIPR - 2012 
> > Petite Sirah</a></li> <li data-value="NW12SYRPSTPCSCRARCIPR - 2012 
> > Syrah" class="active"><a 
> > href="#"><strong>NW</strong>12SYRPSTPCSCRARCIPR - 2012 
> > Syrah</a></li> <li data-value="NW13BDZPSB14B59BRPSIPR - 2013 BD 
> > Zinfandel "><a href="#"><strong>NW</strong>13BDZPSB14B59BRPSIPR - 
> > 2013 BD Zinfandel </a></li> <li data-value="NW13JBZPSB14B59BRPSIPR 
> > - 2013 JB Zinfandel"><a 
> > href="#"><strong>NW</strong>13JBZPSB14B59BRPSIPR - 2013 JB 
> > Zinfandel</a></li> <li data-value="NW13MLOPSB14B59BRPSIPR - 2013 
> > Merlot"><a href="#"><strong>NW</strong>13MLOPSB14B59BRPSIPR - 2013 
> > Merlot</a></li> <li data-value="NW13PSYPSB14B59BRPSIPR - 2013 
> > Petite Sirah"><a href="#"><strong>NW</strong>13PSYPSB14B59BRPSIPR - 
> > 2013 Petite Sirah</a></li> </ul> 
> > 
> > 
> > Charles showed the server response as: 
> > 
> > ["NW12CSVPSTPCSCRARCIPR - 2012 Cabernet Sauvignon", 
> > "NW12MLOPSTPCSCRARCIPR - 2012 Merlot", "NW12PSYPSTPCSCRARCIPR - 
> > 2012 Petite Sirah", "NW12SYRPSTPCSCRARCIPR - 2012 Syrah", 
> > "NW13BDZPSB14B59BRPSIPR - 2013 BD Zinfandel ", 
> > "NW13JBZPSB14B59BRPSIPR - 2013 JB Zinfandel", 
> > "NW13MLOPSB14B59BRPSIPR - 2013 Merlot", "NW13PSYPSB14B59BRPSIPR - 
> > 2013 Petite Sirah", "NW07YAHPSB21CSCRPSIPR - 2007 Yahoosh", 
> > "NW08TREPSB21CSCRPSIPR - 2008 Trembler", "NW10CSRPSB14CSCRPSIPR - 
> > 2010 Cabernet Sauvignon Reserve", "NW11CSOPSB14CSCRPSIPR - 2011 
> > Cabernet Sauvignon Old Block", "NW11MLOPSB14CSCRPSIPR - 2011 
> > Merlot", "NW11MERPSB14CSCRPSIPR - 2011 Meritage", 
> > "NW11PSYPSB14CSCRPSIPR - 2011 Petite Sirah", "NW11CSRPSB14CSCRPSIPR 
> > - 2011 Cabernet Sauvignon Reserve", "NW11SYRPSB14CSCRPSIPR - 2011 
> > Syrah", "NW12MLOPSB14CSCRPSIPR - 2012 Merlot", 
> > "NW12MERPSB14CSCRPSIPR - 2012 Meritage", "NW12CSOPSB14CSCRPSIPR - 
> > 2012 Cabernet Sauvignon Old Block", "NW12PSYPSB14CSCRPSIPR - 2012 
> > Petite Sirah", "NW12SYRPSB14CSCRPSIPR - 2012 Syrah", 
> > "NW13MBLPSB14CSCRPSIPR - 2013 Muscat Blanca", 
> > "NW13RSEPSB14CSCRPSIPR - 2013 Rose", "NW12MLOPSTPPCSCRARCIPR - 2012 
> > Merlot", "NW12MLOFFB21B60BRFFIPR - 2012 Merlot", 
> > "NW13CSVFFB21B60BRFFIPR - 2013 Cabernet Sauvignon", 
> > "NW13RCSFFB21B60BRFFIPR - 2013 Ruby Cabernet Sauvignon", 
> > "NW13SYRFFB21B60BRFFIPR - 2013 Syrah", "NW13ZINFFB21B60BRFFIPR - 
> > 2013 Zinfandel"] 
> > 
> > -- You received this message because you are subscribed to the 
> > Google Groups "Hobo Users" group. To unsubscribe from this group 
> > and stop receiving emails from it, send an email to 
> > [email protected] <javascript:> 
> > <mailto:[email protected] <javascript:>>. To post to this 
> > group, send email to [email protected] <javascript:> 
> > <mailto:[email protected] <javascript:>>. Visit this group at 
> > http://groups.google.com/group/hobousers. For more options, visit 
> > https://groups.google.com/d/optout. 
> -----BEGIN PGP SIGNATURE----- 
> Version: GnuPG v1.4.11 (GNU/Linux) 
>
> iEYEARECAAYFAlY7OtgACgkQF4+m/XX56yk9mACdETVkaQIdx+ccjMo4dn07ewdz 
> JQsAn2G0S9f/9JFd0Sl12fMW4/IQoRCw 
> =AIUq 
> -----END PGP SIGNATURE----- 
>

-- 
You received this message because you are subscribed to the Google Groups "Hobo 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/hobousers.
For more options, visit https://groups.google.com/d/optout.

Reply via email to