Prefill original title and content from projecteuler.net

This commit is contained in:
pfischbeck committed 2020-05-02 20:18:04 +02:00
1 parent 3e85290fc6
commit 38633d6e79
21 files changed
+178 -72

No files matched your search

@@ -1,16 +1,11 @@
class Admin::DashboardController < AdminController
def index
@current_problem_count = Problem.count
@most_recent_pull = Problem.maximum(:pulled_at)
end
def update_problem_count
begin
new_problem_count = params[:problem_count].to_i
raise t('no_problem_count') unless new_problem_count
Problem.update_count(new_problem_count)
redirect_to({:controller => 'admin/dashboard', :action => :index}, notice: t('.success_message'))
rescue => e
redirect_to({:controller => 'admin/dashboard', :action => :index}, alert: t('.failure_message', error: e.message))
end
def pull_problems
PullProblemsJob.perform_later
redirect_to({:controller => 'admin/dashboard', :action => :index}, notice: t('.pull_problems_initiated'))
end
end