Tom Ha wrote:

> I tried, the problem remains...

Here's the issue. Sorry I didn't post it before, but Vista locked up as usual. 
Whine whine whine.

Anyway, this does not print out 'yo':

   puts
   'yo'

You can't put the argument to a method on a new line like that. It's the same 
as 
puts; 'yo'. The first statement outputs a linefeed, and the second one thinks 
about 'yo' briefly, then throws it away (or returns it).

Your replace_html has a linefeed between itself and its first argument.

Tips: Write more unit tests, and don't follow the example of the Rails gurus. 
Never cram everything into one line! Neat formatting would have saved you from 
learning how Ruby parses method arguments...

New question: How is this supposed to work?

<%=
   button_to_function 'Personal account' do |rjs|
     rjs.replace_html 'newagentpersonal',   # this comma , is okay!
          :partial => 'user/agents/newagentpersonal'
   end
%>

(I renamed 'page' to 'rjs' because the world has too danged many variables 
called 'page' in it!)

I thought that :partial would run on the server side, cook a page, and let you 
send it over a wire. So maybe that usage of .replace_html is only going to cram 
your HTML with a big JavaScript string containing more HTML. Maybe you need 
that, but if I tried to cook that partial with fresh variables, collected from 
the page at runtime, they would not affect the partial's contents. And that, in 
turn, would leave me with less reasons to use a partial!

-- 
   Phlip


--~--~---------~--~----~------------~-------~--~----~
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