I used following lines in my create.js.rjs file. I just copied from internet and worked just fine.
page.select("#notice").each { |notice| notice.hide }
page.replace_html('cart', render(@cart))
page[:cart].visual_effect :blind_down if @cart.total_items == 1
page[:current_item].visual_effect :highlight,
:startcolor => "#88ff88",
:endcolor => "#114411"
But now I need to use these 2 lines code in create.js.erb file. Syntax for .rjs and .erb are not same. So what would be the code for .erb file for these 2 linces.
Try:
Update:
Found this code in book Agile Web Development with Rails:
js.rjs
equivalent
js.erb
I kind of getting a feeling that the code you're following is discussed in the linked book in a great detail, so I would suggest taking a look at the book.