This way we'll be able to simplify it a little bit. Note that the original partial didn't include the whole row and only the cells. Since, most of the time, we include the whole row in partials, we're slightly modifying the component.
15 lines
242 B
Ruby
15 lines
242 B
Ruby
class Admin::BudgetInvestments::RowComponent < ApplicationComponent
|
|
attr_reader :investment
|
|
use_helpers :can?
|
|
|
|
def initialize(investment)
|
|
@investment = investment
|
|
end
|
|
|
|
private
|
|
|
|
def budget
|
|
investment.budget
|
|
end
|
|
end
|