Scott Nj wrote:

> how about doing something like this logic

It's good to hear your oppinion on it, but I actually like Fred's 
approach on it a little better. It is clean and fairly readable.

> i am sure there are errors and bugs but i think the basic logic should
> work. it will probably turn out to be fairly clean and readable if
> refactored into a few methods.

The thing is that Fred helped me putting together a method and he's 
spent a lot of time fixing all the bugs I found. Why would I completely 
remake the method just to find a bunch of new bugs?


Okay, I think I should describe my tricky problem a little further. This 
is it: The method does a scan_until(/\{/) which means it stops when 
meeting a curly brace and starts looking for something matching \w+ 
immediately after the curly brace. That is the partial to render.

The string looks like this: {test_partial foo:"bar foo" bar:"foo bar"}

Fine. Then it starts looking for arguments immediately after the partial 
and a space. My problem is that the method only supports values that 
matches \w+. I would like values to be able to match .* or .+.

Now, my problem is that when I change the method so that the value 
should match .+ it doesn't only take the characters between the first 
and the second quotation sign (name: "foo", value: "bar foo"), it 
actually goes on at takes the next quotation sign too (name: "foo", 
value: "bar foo" bar:"). So that we actually get a value that contains 
the right value and then the name of the NEXT argument afterwards.

How can I solve this? If you need further details, just ask.
-- 
Posted via http://www.ruby-forum.com/.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to