Module: BookmarksHelper

Defined in:
app/helpers/bookmarks_helper.rb

Instance Method Summary collapse

Instance Method Details

#bookmarked_objects_lis(user) ⇒ Object



16
17
18
19
20
# File 'app/helpers/bookmarks_helper.rb', line 16

def bookmarked_objects_lis( user )
  if user
    render partial: "bookmarks/list", locals: { user_id: user.id, bookmarks: user.bookmarks }
  end
end

#star_tool(user, bookmarkable) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
14
# File 'app/helpers/bookmarks_helper.rb', line 3

def star_tool( user, bookmarkable )
  if user and bookmarkable

    bookmark = Bookmark.find_by_user_and_bookmarkable( user, bookmarkable )
     'star-tool', '', { 
      'bookmarkable-id' => bookmarkable.id, 'bookmarkable-type' => bookmarkable.class.name,
      'user-id' => user.id, 
      'bookmark' => bookmark.to_json
    }

  end
end