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

Use Railtie to initialize active support #45

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

SebAshton
Copy link

Using:

ruby '2.1.2'
rails '4.1.5'

I was getting the following ActionController Exception:

undefined method `split_stylesheet_link_tag' for #<#<Class:0x007f2dcc874668>:0x007f2dcc8727a0>

I noticed that you were initializing in the Rails::Engine rather than a Rails::Railtie. This PR initializes css_spliter via a Railtie, which resolved my issue.

Thanks.

S

@jhilden
Copy link
Contributor

jhilden commented Oct 23, 2014

Hi @SebAshton thanks for your PR. However I'm a little unsure whether this is the right approach to solving your issue.

Looking at it again I think it might make sense to stop using an isolated engine (since this gem is not creating any routes, this should not be an issue) and from what I'm reading here, then we wouldn't need any additional code to load the helpers:

Then ensure that this file is loaded at the top of your config/application.rb (or in your Gemfile) and it will automatically load models, controllers and helpers inside app, load routes at config/routes.rb, load locales at config/locales/, and load tasks at lib/tasks/.

http://apidock.com/rails/Rails/Engine

I think that would be preferrable to the Railtie + extra initialization code.

Would you mind trying that out?

@SebAshton
Copy link
Author

@jhilden since getting css_splitter into my project and working, I've moved on to another task. Will try to revisit it later on today and amend this PR.

S

@craigmcnamara
Copy link

I'm getting the same issue on a Rails 3.2 project. I'll try to send a pull request to get it fixed, but right now I just copypasta'd the helper method to my ApplicationHelper.

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

Successfully merging this pull request may close these issues.

3 participants