Monday, November 6th, 2006

Rails RJS for Ajax 101

Category: Rails, Ruby

If you haven’t checked out RJS templates, Leon of fallenRogue has written up a walk through article of RJS templates in Rails or Ajax with ease a 101 .rjs walkthrough.

The article walks through a new Rails project from scratch and simply adds some ajax goodness to the comment system:

  1. page["comment_count"].replace_html pluralize(@entry.comments.count, "comment")
  2. page["notice"].replace_html('comment added. This message will self-destruct in 5 seconds.')
  3. page["notice"].show
  4. page.insert_html "after", "comments", "<strong>""</strong>:"+@comment.body+"<hr />"
  5. page.visual_effect "highlight", "comments"
  6. page.delay(5) do
  7.   page.visual_effect "fade", "notice"
  8. end

Posted by Dion Almaer at 1:14 pm

3.7 rating from 62 votes


Comments feed TrackBack URI

My dear loved one,

My name is Miss.Joyic Bamba, 25 years from Sierraleone. My father Mr.Johnson Bamba and I escaped from our country at the heat of the civil war after loosing
my mother and two of my elder brothers in the war. As a result of the
political instability in my country, my father established his cocoa
and coffee export business in Abidjan, Ivory Coast. He went back to
Sierraleone for the sales of his property, and was shot and killed by
the rebel troupes fighting to take over the government of the
country. The death of my father has now made me an orphan and thereby
exposing me to danger.

Before his unfortunate death, my late father had in his personal
account with a bank here in Abidjan the sum of $5.5m. As a result of
the present insecurity of lives and property in this country, I wish
to request that you assist me use your account in your country to
transfer the balance of my father’s account. Again to assist me with
a letter of invitation that will make me get a visa to your country
for residence in order for me to continue my education and to invest
the fund in a viable business venture. I am willing to give you 20%
while 5% has been earmarked for expenses. If this is acceptable to
you, send me a mail through my regular e-mail account so that we can
discuss further on this matter.

thanks for your understanding

best regards,

Miss.Joyic Bamaba.

Comment by Joyic Bamaba — November 10, 2006

I love your site- the previewing comments are very cool!

Comment by lol — December 4, 2006

Leave a comment

You must be logged in to post a comment.