Move votes partials to components
We're going to change the code quite a bit, and with components we can easily extract methods when necessary.
This commit is contained in:
8
app/components/comments/votes_component.rb
Normal file
8
app/components/comments/votes_component.rb
Normal file
@@ -0,0 +1,8 @@
|
||||
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
|
||||
Reference in New Issue
Block a user