Search Results

Search found 2 results on 1 pages for 'peppermonkey'.

Page 1/1 | 1 

  • Rails: combining multiple find requests

    - by peppermonkey
    What I want to do is something like this: searchid = 4 while searchid != -1 @a += A.find(searchid) @b = B.find(searchid) searchid = @b.parentid end The problem being the line @a += A.find(searchid) The error being something like NoMethodError: undefined method `+' for # So, how do you combine multiple 'find' requests?

    Read the article

  • Rails: find_by, conserving leading whitespaces

    - by peppermonkey
    Hi, when I do the following def somefunction @texts = A.find_all_by_someid(someid) respond_to do |format| format.xml { render :xml => @texts } end end it gets the string from the db correctly, except if the string has leading whitespaces, it seems they are trimmed. Note: the whitespaces are there in the db correctly What can I do to conserve those whitespaces? Thanks

    Read the article

1