 
     link_events = @events || {}
 
-    _.each @links, (link, sel) ->
-
-      _.each @$(sel), (el) ->
+    _.eachR @, @links, (link, sel) ->
+
+      _.eachR @, @$(sel), (el) ->
 
         state = link[0]
         data = null

        url = s.create_url()
        url = "/" + url if url.charAt(0) != '/'

        $(el).attr("href", url)

      , @ # each sel
    , @ # each link

    # bind events
    @delegateEvents(link_events)

    data ||= @
    tpl.render(data)

  # Instantiate a partial class with the given data
  #
  # @param [Class] clazz
  # @param [Object] data
  #
  # @return [Object] view class instance
  create_partial: (clazz, data) ->
    data ||= {}
    data.app = @app
