Live data from Hacker News

The Ruby on Rails Tutorial, now with Twitter's Bootstrap

news.railstutorial.org

11–20 of 58 posts

Re: The Ruby on Rails Tutorial, now with Twitter's Bootstrap

#11
post #4

Woohoo. Great timing. Just started re-doing this to learn 3.2. Do you inject bootstrap into the app or use Seyhunak's twitter-bootstrap-rails gem?

The book uses the excellent bootstrap-sass gem. I have personal assurances from the gem's author (tmcdonald) that he will keep it up-to-date with the latest changes in Bootstrap.

Just out of curiosity, where in the tutorial do you start including bootstrap material? I'm currently in the middle of chapter 4, and am planning to hammer out as much of the rest I can this weekend.

Re: The Ruby on Rails Tutorial, now with Twitter's Bootstrap

#12
post #8

Earlier quoted context omitted.

It's using my bootstrap-sass gem. [1] [1]: https://github.com/thomas-mcdonald/bootstrap-sass

I've been wanting to use Bootstrap with some other CSS syntaxes for awhile, and I was wondering how you manage the conversion from less to scss and stay up to date with the latest Bootstrap changes?

In general I wait until the new version is merged into master, and I use GitHub's compare view to see all the changes between the latest version and the previous one, which I keep open on one screen and go through each file updating the bits that have changed. For the Javascripts I just copy the whole folder over, since I don't fiddle with those.

The main exception to this was for 2.0, which had a separate branch for a while so that people could still use bootstrap-sass while updating their application to the new syntax. When 2.0 was merged into master, since it had been under such heavy development I reconverted the entire codebase.

There are a few quirks with the conversion from Less to SCSS, but these tend to be few and far between, and are usually down to me missing a variable somewhere. The main one is the use of namespaced mixins[1]. SCSS doesn't support this, so I have to prefix/suffix the namespace to each mixin within the namespace. Aside from that, and method names/variable notation, there (appears to be, can't speak authoritatively since I haven't really used Less) little difference between the two.

[1]: http://lesscss.org/#-namespaces

Re: The Ruby on Rails Tutorial, now with Twitter's Bootstrap

#17
post #13

Interested in the rationale to choose bootstrap-sass over bootstrap-less. I chose the latter, though can't say I know enough about the divide to feel strongly one way or the other. It works well enough.

There were several reasons for choosing bootstrap-sass. For one, lots of readers recommended it. Moreover, in an introductory tutorial, I wanted to stay as close to the default asset pipeline as possible, which meant erring on the side of Sass. I also personally have a lot more experience with Sass (although, to be fair, LESS is very similar). Finally, the author of the bootstrap-sass gem (Thomas McDonald) got in touch with me and assured me that he plans to keep it up-to-date as Bootstrap itself changes.

Re: The Ruby on Rails Tutorial, now with Twitter's Bootstrap

#18
post #13

Interested in the rationale to choose bootstrap-sass over bootstrap-less. I chose the latter, though can't say I know enough about the divide to feel strongly one way or the other. It works well enough.

http://wrangl.com/sass-v-less

Particularly: sass == Ruby. less == JavaScript.

I'm not saying that's good or bad, but it's probably "why".

Re: The Ruby on Rails Tutorial, now with Twitter's Bootstrap

#19
post #13

Interested in the rationale to choose bootstrap-sass over bootstrap-less. I chose the latter, though can't say I know enough about the divide to feel strongly one way or the other. It works well enough.

The asset pipeline introduced in Rails 3.1 includes Sass by default, which means nothing to configure if you use bootstrap-sass.

Re: The Ruby on Rails Tutorial, now with Twitter's Bootstrap

#20
post #4

Earlier quoted context omitted.

The book uses the excellent bootstrap-sass gem. I have personal assurances from the gem's author (tmcdonald) that he will keep it up-to-date with the latest changes in Bootstrap.

Just out of curiosity, where in the tutorial do you start including bootstrap material? I'm currently in the middle of chapter 4, and am planning to hammer out as much of the rest I can this weekend.

The Bootstrap material starts in Chapter 5 (http://ruby.railstutorial.org/chapters/filling-in-the-layout...).
Post reply on HN