Move progress bars form partial to a component
This way we can move some of the view logic to the Ruby class. It'll also make it easier to write tests for it.
This commit is contained in:
15
app/components/admin/progress_bars/form_component.rb
Normal file
15
app/components/admin/progress_bars/form_component.rb
Normal file
@@ -0,0 +1,15 @@
|
||||
class Admin::ProgressBars::FormComponent < ApplicationComponent
|
||||
include TranslatableFormHelper
|
||||
include GlobalizeHelper
|
||||
attr_reader :progress_bar
|
||||
|
||||
def initialize(progress_bar)
|
||||
@progress_bar = progress_bar
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def progress_options
|
||||
{ min: ProgressBar::RANGE.min, max: ProgressBar::RANGE.max, step: 1 }
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user