Hi Colin,

Colin Summers wrote:

> Fire up Mongrel on post 3000. It loads the index.rhtml file just file.
> Shows me the link which is coded like this:
>
>    link_to_remote("Say hello",{:action => 'hello'})
>
> then hello.rjs is just
>    page.alert "Hello!"
>
> Okay, I'm missing the "world" part.
>
> I load the first page and then click on the link. The log says:
> Processing JavaController#index

The action that you *intend* to be invoked by your link is 'hello'.
According to the log you posted, clicking the link is *actually* invoking
the 'index' action instead.  The problem may lie in your coding of the
link_to_remote.  Check the page source of your 'index' view.  It should have
an Ajax call to 'java/hello'.  If it doesn't, try changing your
link_to_remote to:

link_to_remote("Say hello", :url =>{:action => 'hello'})

or even more readably...

link_to_remote("Say hello", :url =>{:controller => 'java', :action =>
'hello'})

If you're page source already contains the Ajax request to 'java/hello',
then the problem's in your routes.

HTH,
Bill


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