[Rails] Re: Starting server is failing on Mac OSX 10.6 Snow Leopard

2009-12-06 Thread timr
I need help getting hpricot running on mac OS 10.6.2, ruby 1.9.1. Others have had the same problem apparently no answer has been posted. It seems that the gem install is not compiling one of the bundle files with the correct architecture. I am asking again for any help. Thanks in advance, Tim

[Rails] hpricot on mac os 10.6

2009-12-06 Thread timr
Could anyone help me get hpricot working on mac os 10.6.2 (ruby version 1.9.2)? Example install is provided. The hpricot_scan bundle is apparently not the correct architecture. I don't know what to do about that since I tried providing the architecture during the gem install. Thanks in advance,

[Rails] Re: after matching a regexp, how can I modify the pre-match string?

2009-07-30 Thread timr
I often use one liners to search and replace within strings: my string is a string.gsub(/(st.)/, 'big \1') = my big string is a big string Note two important syntax items: 1. put parentheses around the item to be referenced later... 2. Parenthetically captured items are accessible via \1

[Rails] Re: render syntax has me stumped

2009-07-27 Thread timr
Thanks for answering Vikrant, Did render change recently, because the internet is littered with advice saying render :controller = 'con_name', :action = 'action_name' is valid syntax. And if you can say render 'controller/action', why not allow it to be stated the other way too? Tim On Jul

[Rails] Re: padawan seeks advice from jedi masters to create toggle box via ajax/rjs before slitting wrists with ruby powered light-saber.

2009-07-24 Thread timr
Got it!!! Here are the key steps: The view should decide which image to present based on the info in the order.placed_date column and link it remotely to the toggle action. Don't mind the span tags, they are there just to hide some text which can be used for sorting (can't really sort off an

[Rails] Re: problem using rjs, please help

2009-07-23 Thread timr
Thank you. It works. I will put the gasoline back in the truck...for now. Tim On Jul 23, 10:01 am, sami ssza...@gmail.com wrote: sijo is right , when you use :update that try to update that fragment and send the response to that fragment before the calling of rjs the response already send to

[Rails] Re: Not really a Rails post but...

2009-06-20 Thread timr
Hi Dale, It is a good ruby question (and rails is a ruby framework--so I think it is fair game). I don't know that the Levenshtien suggestion will be that helpful. (You can try it with require 'text', since it is part of the built in text module) The algorithm it uses is based on the number of

[Rails] Re: Searching/Sorting an Array of Hashes

2009-05-27 Thread timr
. Cheers! timr wrote: Hi again Robert, There might be methods build into rails for doing this, but when you have a very specific case, you might just roll out your own methods   to get exactly what you want: =begin given a data structure like @contacts = [{:first_name='tim

[Rails] Re: Searching/Sorting an Array of Hashes

2009-05-25 Thread timr
Hi again Robert, There might be methods build into rails for doing this, but when you have a very specific case, you might just roll out your own methods to get exactly what you want: =begin given a data structure like @contacts = [{:first_name='tim', :last_name='rand', :id =

[Rails] Re: Detecting Characters other the ASCII (Other than English)

2009-05-25 Thread timr
No /w will not work. And . (period) will not work either. here is asdjflaw日本erjocd some text the japanese within this text looks like this \346\227\245\346\234\254 in unicode. it would not be matched by /w (letter or number set) or . (any character). each of the \ddd sets in the unicode character