addressable has a helper method for this

This commit is contained in:
Maxwell Salzberg 2012-04-28 13:24:34 -07:00
parent 1b6c33aff5
commit 7ebf5380c6

View file

@ -20,7 +20,7 @@ module PostsHelper
def post_iframe_url(post_id, opts={})
opts[:width] ||= 516
opts[:height] ||= 315
host = AppConfig[:pod_uri].port ==80 ? AppConfig[:pod_uri].host : "#{AppConfig[:pod_uri].host}:#{AppConfig[:pod_uri].port}"
host = AppConfig[:pod_uri].site
"<iframe src='#{Rails.application.routes.url_helpers.post_url(post_id, :host => host)}' width='#{opts[:width]}px' height='#{opts[:height]}px' frameBorder='0'></iframe>".html_safe
end
end