Class: FactorySeeder::DashboardController

Inherits:
ApplicationController show all
Defined in:
app/controllers/factory_seeder/dashboard_controller.rb

Instance Method Summary collapse

Instance Method Details

#indexObject



5
6
7
8
# File 'app/controllers/factory_seeder/dashboard_controller.rb', line 5

def index
  @factories = FactorySeeder.scan_loaded_factories
  @seeds_info = FactorySeeder.list_seeds
end

#run_all_seedsObject



22
23
24
25
26
27
28
# File 'app/controllers/factory_seeder/dashboard_controller.rb', line 22

def run_all_seeds
  flash[:info] = 'Seed system coming soon! For now, use the factory generation interface.'
  redirect_to root_path
rescue StandardError => e
  flash[:error] = "Error running seeds: #{e.message}"
  redirect_to root_path
end

#run_seedObject



10
11
12
13
14
15
16
17
18
19
20
# File 'app/controllers/factory_seeder/dashboard_controller.rb', line 10

def run_seed
  params[:name]

  begin
    flash[:info] = 'Seed system coming soon! For now, use the factory generation interface.'
    redirect_to root_path
  rescue StandardError => e
    flash[:error] = "Error running seed: #{e.message}"
    redirect_to root_path
  end
end