Rails 3.1 asset pipeline compatibility #563

justinfrench opened this Issue May 18, 2011 · 2 comments


None yet

2 participants


No description provided.


Are you are referring to the changes from the epic Gemfile commit ?
I'm pretty sure that compatibility-wise, you don't have to do anything. I'll admit it was a bit hard to read through the barrage of comments on that commit, but from what I could gleen from the level-headed posts, the only thing that "changes" is additional lookups in the app/assets folder to pick up scripts and stylesheets from there.

If this is less about compatibility and more about leveraging the newly standardized and default frameworks of coffescript and sass ( flameproof suit ON) then...

Would be nice to utilize sass's dynamic parts to rework how the current formtastic.css/formtastic_changes.css works though-- not sure how the implimentation would look though. It was, and continues to be an elegant solution, but surely serving a single stylesheet for an application would be better than even an elegant serving of multiple style sheets that override each other.


@colinross, yeah, this was a memory-jogger for me. We're "compatible" already. What we can do, however, is shift the generator template into public so that the asset pipeline picks them up and effectively deprecate the generator that copies stuff into the app's public dir. That's the first win, although I want to make sure people can easily opt-out of formtastic.css before committing. Just need to look into sprockets a bit more.

Shifting to SASS would be a separate issue (we can take advantage of variables mostly), but there really isn't a massive win with SASS with the direction I'm trying to push the CSS (simple class selectors with very little scoping/nesting).

@justinfrench justinfrench added a commit that closed this issue May 30, 2011
@justinfrench Rails 3.1 Asset Pipeline compatibility (Fixes #563)
* removed formtastic_changes.css
* moved formtastic.css into app/assets/stylesheets/formtastic.css
* changed install generator to only copy formtastic.css in Rails < 3.1
* changed install generator to source the stylesheet template from new location
* added formtastic/engine.rb, which seems to be needed to trigger asset pipeline
* updated documentation

Also modified install instructions in README to include bundling from master.

For Rails 3.1, instead of copying the styles across with a generator, simply add them to your application.css with sprockets:

`*= require formtastic`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment