On 9 Oct 2008, at 10:15, David Trasbo wrote:
>
> Frederick Cheung wrote:
>
>>> Let me start out by saying that both the argument, name, value,
>>> arguments, to and from has the values they should have when I debug
>>> them, but for some reason I'm getting an error that looks like this:
>
>> A general point - it may not be advisable to modify the string while
>> stringscanner is iterating over it
>
> I don't see other possibilities.
accumulate the replacements you need and do them at the end (last one
first)
>
>
>> At least on my version of ruby String#split! doesn't exist, and the
>> errors suggest it didn't actually do what you think it did (and I
>> struggle to see how it could exist)
>> name, value = arguments.split(/:/) would probably work better.
>
> I see, that is corrected now.
>
>> The error you get later is a reflection of the fact that the keys in
>> your locals are things like bar=foo (and i imagine the values are
>> blank)
>
> Unfortunately that is not true. When I comment out the "content[from,
> to] = render..." line and put "puts debug arguments" on the line
> before
> so it looks like this:
>
given how :locals is handled it seems highly likely
> ...
> s.skip_until /\}/
> puts debug arguments
> #content[from, to] = render :partial => "drops/#{partial}", :locals =>
> arguments
> ...
>
> I get output similar to this:
>
> ---
> foo: bars
> bar: foos
>
It would be a lot simpler to just stick a breakpoint in there (or
output arguments.inspect)
> I assume this means that the arguments hash is correctly formatted.
> But
> I'm getting the error when the "content[from, to] = render..." line is
> NOT commented out, anyway.
> --
> 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
-~----------~----~----~----~------~----~------~--~---