This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<%= link_to "Upvote", vote_polls_path(poll, :vote_type => "upvotes"), :remote => true %> | |
<%= link_to "Downvote", vote_polls_path(poll, :vote_type => "downvotes"), :remote => true %> | |
# Add :vote to your set_poll before_action | |
def vote | |
@poll.increment!(params[:vote_type].to_sym) if ["upvotes", "downvotes"].include?(params[:vote_type]) | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class BriefPdf < Prawn::Document | |
def initialize(brief, user) | |
super(top_margin: 70, left_margin: 80, right_margin: 80, bottom_margin: 50) | |
@brief = brief | |
@user = user | |
header | |
company | |
contact | |
project | |
end |