add: project's lesson_url

This commit is contained in:
vilet.yy 2021-04-08 15:13:35 +08:00
parent c3a1fb78ea
commit 04a1376820
5 changed files with 11 additions and 3 deletions

View File

@ -183,7 +183,7 @@ class ProjectsController < ApplicationController
private
def project_params
params.permit(:user_id, :name, :description, :repository_name, :website,
params.permit(:user_id, :name, :description, :repository_name, :website, :lesson_url,
:project_category_id, :project_language_id, :license_id, :ignore_id, :private)
end

View File

@ -5,4 +5,5 @@ json.description @project.description
json.project_category_id @project.project_category_id
json.project_language_id @project.project_language_id
json.is_public @project.is_public
json.website @project.website
json.website @project.website
json.lesson_url @project.lesson_url

View File

@ -1,5 +1,6 @@
json.content @project.content
json.website @project.website
json.lesson_url @project.lesson_url
if @result[:readme].blank?
json.readme nil
else

View File

@ -6,4 +6,5 @@ json.project_category_id @project.project_category_id
json.project_language_id @project.project_language_id
json.private !@project.is_public
json.website @project.website
json.project_units @project.project_units.pluck(:unit_type)
json.project_units @project.project_units.pluck(:unit_type)
json.lesson_url @project.lesson_url

View File

@ -0,0 +1,5 @@
class AddLessonUrlToProjects < ActiveRecord::Migration[5.2]
def change
add_column :projects, :lesson_url, :string
end
end