This commit is contained in:
14
app/controllers/books/bookmarks_controller.rb
Normal file
14
app/controllers/books/bookmarks_controller.rb
Normal file
@@ -0,0 +1,14 @@
|
||||
class Books::BookmarksController < ApplicationController
|
||||
allow_unauthenticated_access
|
||||
|
||||
include BookScoped
|
||||
|
||||
def show
|
||||
@leaf = @book.leaves.active.find_by(id: last_read_leaf_id) if last_read_leaf_id.present?
|
||||
end
|
||||
|
||||
private
|
||||
def last_read_leaf_id
|
||||
cookies["reading_progress_#{@book.id}"]
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user