Skip to content

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