Quantcast
Viewing all articles
Browse latest Browse all 6760

Add new view after zammad

Infos:

  • Used Zammad version: 6.3.1-38
  • Used Zammad installation type: docker-compose
  • Operating system: ubuntu20.04
  • Browser + version: Mozilla/5.0 (Windows NT 10.0; Win64; x64)

Expected behavior:

  • when we login access goto the zammad ,we can use domain/docs to view custom website

Actual behavior:

Steps to reproduce the behavior:

  • Seems like we can use ruby to add a new(custom ) static website after the zammad.
    1.I add the route
get '/docs', to: 'static_pages#docs'
  1. create the app controller
class StaticPagesController < ApplicationController
  before_action :authenticate_user!  # 确保用户登录后才能访问

  def docs
    render template: 'static_pages/docs'
  end
end
  1. create the view:
    app/views/static_pages/
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Documentation</title>
</head>
<body>
    <h1>Documentation</h1>
    <p>Welcome to the documentation page!</p>
    <p>This page is accessible only to logged-in users.</p>
</body>
</html>

when i finish the step 1\2\3 and i restart the container zammad-railserver;

I try to acces the domain with /docs ;the result are as follows. How to do and fix the error! Thanks for reply


Viewing all articles
Browse latest Browse all 6760

Trending Articles