* Update Travis.yml * Update README * Update README * Adjust test to not rely on env vars * Update encryption * Refactor * Update env key * Stub AWS calls * Create ApplicationConfig * Fix specs * Fix lint * Update ApplicationConfig * Remove travis env vars * Fix lint * Extend character limit to 100 * Add env to travis * Take out auto-restart after deploy * Immediately discarded test cache * Stub GA in request specs * Stub Pusher * Fix broken specs * Update fixture * Add CodeClimate id * Change CodeClimate key * Remove merge mistakes * WIP * Add Envied gem & Change README * Add missing keys * Add missing key * Update fixture * Fix broken spec * Add Slack Notification for Travis * Fix wording * Fix typo
34 lines
867 B
Ruby
34 lines
867 B
Ruby
class Internal::WelcomeController < Internal::ApplicationController
|
||
layout "internal"
|
||
|
||
def index
|
||
@daily_threads = Article.where("title LIKE 'Welcome Thread - %'")
|
||
end
|
||
|
||
def create
|
||
welcome_thread = Article.create(
|
||
body_markdown: welcome_thread_content,
|
||
user_id: ApplicationConfig["DEVTO_USER_ID"],
|
||
)
|
||
redirect_to welcome_thread.path + "/edit"
|
||
end
|
||
|
||
private
|
||
|
||
def welcome_thread_content
|
||
<<~HEREDOC
|
||
---
|
||
title: Welcome Thread - v0
|
||
published: false
|
||
description: Introduce yourself to the community!
|
||
tags: welcome
|
||
---
|
||
|
||
Hey there! Welcome to dev.to!
|
||
|
||

|
||
|
||
Leave a comment below to introduce yourself to the community!✌️
|
||
HEREDOC
|
||
end
|
||
end
|