On Sep 23, 8:37 am, Marnen Laibow-Koser <li...@ruby-forum.com> wrote:
> nobosh wrote:
> > Hello, I'm interested in learning the correct/smart approach for
> > implementing a web page with tabs and a content panel... When the tab
> > is clicked by the user the tab's content is fetched and inserted with
> > jQuery... no page refresh...
>
> > Example, Facebook, when you click Photos or Events, it doesn't refresh
> > the browser, just replaces the content with AJAX in the page's content
> > panel.
>
> > Any pointers, tips, tutorials? thanks!
>
> This is fairly simple Ajax.  What part do you need help with?

Thanks Marnen. Right now I need helping understanding the end to end
flow in Rails. I could use help with the following example.. Lets take
Facebook.
When you're on Facebook.com, and click MESSAGES, the URL changes to
(facebook.com/?sk=messages) and then AJAX is used to download the HTML/
JS content which is injected with JavaScript into the content
pannel... No browser refresh which is what I'm after.

My specific questions are:
1. For the content that is download via AJAX, is that content coming
from a rails partial?... like
(app>views>messages>_messagestable.html.erb
2. Where should the JavaScript reside that knows to fetch the messages
content and then inject the content into the content panel? (is that
the application.js?
3. Once the messages content (_messagestable.html.erb) is injected
into the content panel, it will require new JavaScript functions
specific to that content... Where should that live?

Thanks



> And remember to make it degrade gracefully: the links should still work
> (as conventional page links) with JS turned off, and each tab should
> have its own URL (abusing the #fragment portion of the URL for this may
> be useful).
>
> Best,
> --
> Marnen Laibow-Koserhttp://www.marnen.org
> mar...@marnen.org
> --
> Posted viahttp://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 rubyonrails-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to