Integration with Twitter Bootstrap

562 views
Skip to first unread message

Atastor

unread,
Feb 17, 2012, 4:40:58 PM2/17/12
to actives...@googlegroups.com
Well, mostly Twitters Bootstrap and ActiveScaffold seem to be orthogonal, i.e., not much problems integrating both, at least not in the first few steps.

I am now trying to integrate  TB's icons as described here: http://twitter.github.com/bootstrap/base-css.html. To conform the icons license one has to use TB's way, which means writing e.g. <i class="icon-trash></i> to get the trash can wherever you want it. Alas thats not the way, which is preferred by active scaffold (which is via CSS).

Soooo..what do you think? Where should I start? Do I have to overwrite e.g. the view_helpers.rb?

Regards, and (as its carnival here in the Rhineland:) Oche Alaaf!
Michael

clyfe

unread,
Feb 21, 2012, 8:07:30 AM2/21/12
to actives...@googlegroups.com
AS adds background images to classes via css.
You would have to either:
* extract the twitter bootstrap icons in individual files and replace the ones in AS or
* edit the AS views markup and add the <i> tags, then remove the AS icons css

clyfe

unread,
Feb 21, 2012, 8:08:53 AM2/21/12
to actives...@googlegroups.com
Sergio made a lot of progress in separating the AS css to allow customization, now there are individual files for layout/icons etc that you can cherry pick in includes.

clyfe

unread,
Mar 5, 2012, 6:38:26 PM3/5/12
to actives...@googlegroups.com
My gist to make AS and TB play nice. Quite little work.
 

Sergio Cambra

unread,
Mar 6, 2012, 4:17:52 AM3/6/12
to actives...@googlegroups.com
Can you add to wiki, in advanced topics?

clyfe

unread,
Mar 6, 2012, 4:45:27 AM3/6/12
to actives...@googlegroups.com

Sergio Cambra

unread,
Mar 6, 2012, 5:25:29 AM3/6/12
to actives...@googlegroups.com
On Martes, 6 de marzo de 2012 01:45:27 clyfe escribió:
> Done:
> https://github.com/activescaffold/active_scaffold/wiki/Look-and-feel-customi
> zation


Great



>
> PS.Have you seen my pull request?
> https://github.com/activescaffold/active_scaffold/pull/143
> Could you please give it a thought?

Yes, but I want to keep global method too, as in form overrides which method
without class prefix is tried too. And use a helper to clean up view code.

Hernan Astudillo

unread,
Mar 6, 2012, 12:36:46 PM3/6/12
to actives...@googlegroups.com
awesome!! TB is a great complement. specially for navigation menus




--
You received this message because you are subscribed to the Google Groups "ActiveScaffold : Ruby on Rails plugin" group.
To post to this group, send email to actives...@googlegroups.com.
To unsubscribe from this group, send email to activescaffol...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/activescaffold?hl=en.


clyfe

unread,
Mar 6, 2012, 5:42:18 PM3/6/12
to actives...@googlegroups.com
Is it ok if i name the helper exactly "list_row_class", and have it always called in view (no more "respond_to?") ?

# view_helpers.rb
def list_row_class(record)
  class_override_helper = :"#{clean_class_name(record.class.name)}_list_row_class"
  respond_to?(class_override_helper) ? send(class_override_helper, record) : ''
end

# _list_record.html.erb
tr_class = cycle("", "even-record") + ' ' + list_row_class(record)

Atastor

unread,
Mar 7, 2012, 3:49:08 AM3/7/12
to actives...@googlegroups.com
Nice :-) 

Thanks loads!
Michael

Sergio Cambra

unread,
Mar 8, 2012, 3:25:44 AM3/8/12
to actives...@googlegroups.com
Great, it's backwards compatible

Nick Roosevelt

unread,
Mar 8, 2012, 5:28:13 AM3/8/12
to actives...@googlegroups.com
simplescrum.heroku.com now uses Twitter Bootstrap in addition to ActiveScaffold and ActiveScaffoldExport

Thank you all for all of your contributions!

--
You received this message because you are subscribed to the Google Groups "ActiveScaffold : Ruby on Rails plugin" group.
Reply all
Reply to author
Forward
0 new messages