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

undefined method `mathjax_path' in a Rails engine #16

Open
dongli opened this issue Aug 14, 2015 · 1 comment
Open

undefined method `mathjax_path' in a Rails engine #16

dongli opened this issue Aug 14, 2015 · 1 comment

Comments

@dongli
Copy link

dongli commented Aug 14, 2015

When I change the layout of an engine to the one of the application, I got the following error:

ActionView::Template::Error (undefined method `mathjax_path' for #<#<Class:0x007fd2bad1cbf0>:0x007fd2c1cca600>):
    12:       TeX: { equationNumbers: { autoNumber: "all" } }
    13:     });
    14:   </script>
    15:   <%= mathjax_tag %>
    16:   <%= stylesheet_link_tag    'application', media: 'all', 'data-turbolinks-track' => true %>
    17:   <%= javascript_include_tag 'application', 'data-turbolinks-track' => true %>
    18:   <%= csrf_meta_tags %>
  app/views/layouts/application.html.erb:15:in `_app_views_layouts_application_html_erb___3320660116759457037_70271586191680'

and I try to find out mathjax_path, but only found it in mathjax-rails-2.5.1/lib/mathjax/rails/helpers.rb:

module Mathjax
  module Rails
    module ViewHelpers
      def mathjax_tag(opt={})
        opt[:config] ||= 'TeX-AMS_HTML-full.js'
        opt[:config] = nil if opt[:config] == false
        "<script src=\"#{mathjax_path(:uri=>'MathJax.js', config: opt[:config])}\" type=\"text/javascript\"></script>".html_safe
      end 
    end 
  end 
end
ActionView::Base.send :include, Mathjax::Rails::ViewHelpers
@dongli
Copy link
Author

dongli commented Aug 14, 2015

I think we need main_app.mathjax_path.

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