```coffeescript
# Place all the behaviors and hooks related to the matching controller here.
# All this logic will automatically be available in application.js.
# You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/

$(document).ready ->

  # Dynamic styling when clicking on the sidebar folders
  $(".menu-level1").click ->
    $(this).children("i.arrow").toggleClass "icon-chevron-right"
    $(this).children("i.arrow").toggleClass "icon-chevron-down"
    $(this).children("i.folder").toggleClass "icon-folder-close-alt"
    $(this).children("i.folder").toggleClass "icon-folder-open-alt"

  # Dynamid styling when clicking on a feed in the sidebar
  $("[data-feed]").click ->
    $("[data-feed]").parent().removeClass "active"
    $(this).parent().addClass "active"

  # Load new feed entries when clicking on the Refresh button
  $("[data-refresh]").click ->
    $("> i.icon-repeat", this).addClass "icon-spin"
    # Function to insert new entries in the list
    insert_entries = (entries) ->
      $("#feed-entries").prepend entries
      $("[data-refresh] > i.icon-repeat").removeClass "icon-spin"
    $.get "/feeds/1", null, insert_entries
```

Use jquery function load() instead of get() when refreshing a feed. Instead of inserting new new entries, the whole list of entries for the feed is inserted, replacing the previous list.
user
```coffeescript
# Place all the behaviors and hooks related to the matching controller here.
# All this logic will automatically be available in application.js.
# You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/

$(document).ready ->

##########################################################
# DYNAMIC STYLES
##########################################################

  # Dynamic styling when clicking on the sidebar folders
  $(".menu-level1").click ->
    $(this).children("i.arrow").toggleClass "icon-chevron-right"
    $(this).children("i.arrow").toggleClass "icon-chevron-down"
    $(this).children("i.folder").toggleClass "icon-folder-close-alt"
    $(this).children("i.folder").toggleClass "icon-folder-open-alt"

  # Dynamid styling when clicking on a feed in the sidebar
  $("[data-feed]").click ->
    $("[data-feed]").parent().removeClass "active"
    $(this).parent().addClass "active"

##########################################################
# AJAX
##########################################################

  # Load new feed entries when clicking on the Refresh button
  $("[data-refresh]").click ->
    $("> i.icon-repeat", this).addClass "icon-spin"
    # Function to insert new entries in the list
    insert_entries = (entries) ->
      $("[data-refresh] > i.icon-repeat").removeClass "icon-spin"
    $("#feed-entries").load "/feeds/1", null, insert_entries
```
assistant