Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ DEPENDENCIES
webmock (~> 3.0)

RUBY VERSION
ruby 2.3.3p222
ruby 2.4.1p111
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍


BUNDLED WITH
1.15.4
4 changes: 4 additions & 0 deletions app/helpers/application_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ def display_date(date)
date.to_formatted_s(:long_ordinal)
end

def wishlist_url(wishlist)
request.base_url+"/wishlists/#{wishlist.id}"
end
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is actually built into Rails, so you can remove this method. As an added bonus, the pre-included method will match your app configuration without extra work (ex. with subdomains, ports, friendly urls/slugs, etc.)

Here's a section of the official Rails Guides talking about _path and _url helpers.


private

def current_user_pronouns(user, perspectives, capitalize: true)
Expand Down
11 changes: 3 additions & 8 deletions app/views/wishlists/show.html.erb
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
<div class="container">
<h2>
<%= @wishlist.name %>

<% if Rails.env.production? %>
<% url_share = "https://project-playtime-staging.herokuapp.com/wishlists/#{@wishlist.id}" %>
<% else %>
<% url_share = "https://project-playtime-staging.herokuapp.com/wishlists/#{@wishlist.id}" %>
<% end %>

<%= social_share_button_tag("Are you a hero of play? #{@wishlist.name} needs your help!",:url => url_share,desc: "Are you a hero of play? #{@wishlist.name} needs your help!") %>
<%= social_share_button_tag("Are you a hero of play? #{@wishlist.name} needs your help!",
url: wishlist_url(@wishlist),
desc: "Are you a hero of play? #{@wishlist.name} needs your help!") %>
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! 👍 I like how you broke this up into multiple lines. Much easier to read!

</h2>

<% if current_user.can_manage?(@wishlist) %>
Expand Down