module DogEars::Controller
Public Instance Methods
create()
click to toggle source
# File lib/dog_ears/controller.rb, line 32 def create path = params[:path] title = params[:title] level = Bookmark::LEVELS[params[:level].to_i] title = nil if title == 'null' user = current_user b = DogEars.bookmark(user, path, title, level) render partial: '/dog_ears/dog_ears', locals: { bookmark_url: '', b: b, path: b.path, method: 'GET' } end
destroy()
click to toggle source
# File lib/dog_ears/controller.rb, line 48 def destroy @bookmark = DogEars::Bookmark.for_user(current_user).find(params[:id]) @bookmark.destroy render partial: '/dog_ears/dog_ears', locals: { bookmark_url: '', b: nil, path: @bookmark.path, method: 'GET' } end
get_users()
click to toggle source
# File lib/dog_ears/controller.rb, line 43 def get_users uu = User.where('id <> ?', current_user.id) render json: uu.inject({}){|a,e| a[e.id] = e.name; a }.to_json end
index()
click to toggle source
# File lib/dog_ears/controller.rb, line 27 def index @bookmarks = DogEars::Bookmark.for_user(current_user).where(level: params[:level]) render json: @bookmarks.to_json end