foalfetch/app/controllers/chapters_controller.rb

12 lines
292 B
Ruby
Raw Normal View History

2024-04-04 10:21:23 +02:00
# frozen_string_literal: true
require 'redcarpet'
class ChaptersController < ApplicationController
def show
@story = Story.find(params[:story_id])
@chapter = @story.chapters.find_by(number: params[:id])
@rendered_html = Ebook::EpubGenerator.render_chapter(@chapter)
end
end