We're going to change the code quite a bit, and with components we can easily extract methods when necessary.
9 lines
220 B
Ruby
9 lines
220 B
Ruby
class Comments::VotesComponent < ApplicationComponent
|
|
attr_reader :comment
|
|
delegate :user_signed_in?, :can?, :link_to_signin, :link_to_signup, to: :helpers
|
|
|
|
def initialize(comment)
|
|
@comment = comment
|
|
end
|
|
end
|