Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rails 3 compatible? #6

Open
professor opened this issue Jul 19, 2011 · 1 comment
Open

Rails 3 compatible? #6

professor opened this issue Jul 19, 2011 · 1 comment

Comments

@professor
Copy link

Morning glory has been very helpful for me with my rails 2 application. I'm in the process of upgrading to rails 3, and I'm seeing this error message. I'm wondering if anyone has used this plugin with rails 3. Thanks!

ActionView::Template::Error (wrong number of arguments (2 for 1)):

vendor/plugins/morning_glory/lib/asset_tag_helper.rb:5:in `rewrite_asset_path'

@professor
Copy link
Author

Solution? modify vendor/plugins/morning_glory/lib/asset_tag_helper.rb and replace existing method with this one:

def rewrite_asset_path(source, path = nil)
  if path && path.respond_to?(:call)
    return path.call(source)
  elsif path && path.is_a?(String)
    return path % [source]
  end

  asset_id = rails_asset_id(source)
  if asset_id.blank?
    source
  else
   # AB: As of June AWS Cloudfront supports HTTPS requests. This alternative code path should now be redundant.
    # # If the request isn't SSL, or if the request is SSL and the SSL host is set
    # if !request.ssl? || (request.ssl? && !AssetHostingWithMinimumSsl::asset_ssl_host.empty?)
    #   File.join('/', ENV['RAILS_ASSET_ID'], source)
    # else
    #   source + "?#{asset_id}"
    # end
    File.join('/', ENV['RAILS_ASSET_ID'], source)
  end
end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant