Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Rails 3.1 asset pipeline compatibility #563

Closed
justinfrench opened this Issue · 2 comments

2 participants

@justinfrench

No description provided.

@colinross

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.

@justinfrench

@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 closed this issue from a commit
@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`
4f4b069
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.