Rails: How to pass a post's URL in an after_commit method
问题 I'm having some real troubles figuring out how to create a url for each user post (called supportposts in my app) and pass it to an after_commit method. Right now I can pass attributes of the supportpost, such as title and content, which is shared to twitter: supportpost.rb after_commit :share_all def share_all if user.authentications.where(:provider => 'twitter').any? user.twitter_share(title, content) end end user.rb def twitter_share(title, content) twitter.update("#{title}, #{content}") #