seyhunak / twitter-bootstrap-rails Goto Github PK
View Code? Open in Web Editor NEWTwitter Bootstrap for Rails 6.0, Rails 5 - Rails 4.x Asset Pipeline
Home Page: https://github.com/seyhunak/twitter-bootstrap-rails
Twitter Bootstrap for Rails 6.0, Rails 5 - Rails 4.x Asset Pipeline
Home Page: https://github.com/seyhunak/twitter-bootstrap-rails
Bootstrapped works fine, looks great, except when I edit a resource it creates a new record instead?
I generated a model page and views with bootstrapped:
rails g bootstrap:install
rails g scaffold page title:string permalink:string content:text
rails g bootstrap:themed pages
edit.html.erb:
<%= bootstrap_form_for :page, :url => pages_path, :html => { :class => :form } do |f| -%>
<%= render :partial => "form", :locals => {:f => f} %>
<% end -%>
new.html.erb:
<%= bootstrap_form_for :page, :url => pages_path, :html => { :class => :form } do |f| -%>
<%= render :partial => "form", :locals => {:f => f} %>
<% end -%>
When I click on edit in index page, I get a filled in form for this record, when clicking save it makes a copy and I get a new record instead of it updating the original.
Here is my log when I click on edit:
Started GET "/pages/7/edit" for 127.0.0.1 at 2012-01-18 11:48:10 +0100
Processing by PagesController#edit as HTML
Parameters: {"id"=>"7"}
Page Load (0.4ms) SELECT pages
.* FROM pages
WHERE pages
.id
= 7 LIMIT 1
Rendered pages/_form.html.erb (7.9ms)
Rendered pages/edit.html.erb within layouts/application (12.5ms)
Completed 200 OK in 35ms (Views: 31.4ms | ActiveRecord: 1.5ms)
Now when I click on save button on this edit page it calls the create instead of update method on my controller:
Started POST "/pages" for 127.0.0.1 at 2012-01-18 11:48:57 +0100
Processing by PagesController#create as HTML
Parameters: {"utf8"=>"✓", "authenticity_token"=>"nrS9vW24ogvlHEWdRT28QIuWfr9u1JG4qotZEqxL/Zg=", "page"=>{"title"=>"hello world2", "permalink"=>"hello", "content"=>"blabla"}}
(0.2ms) BEGIN
SQL (0.4ms) INSERT INTO pages
(content
, created_at
, permalink
, title
, updated_at
) VALUES ('blabla', '2012-01-18 10:48:57', 'hello', 'hello world2', '2012-01-18 10:48:57')
(0.6ms) COMMIT
Redirected to http://localhost:3000/pages/8
Completed 302 Found in 13ms
Started GET "/pages/8" for 127.0.0.1 at 2012-01-18 11:48:57 +0100
Processing by PagesController#show as HTML
Parameters: {"id"=>"8"}
Page Load (0.3ms) SELECT pages
.* FROM pages
WHERE pages
.id
= 8 LIMIT 1
Rendered pages/show.html.erb within layouts/application (6.1ms)
Completed 200 OK in 78ms (Views: 74.6ms | ActiveRecord: 1.3ms)
class BootstrapFormBuilder < ActionView::Helpers::FormBuilder
helpers = field_helpers +
%w{date_select datetime_select time_select} +
%w{collection_select select country_select time_zone_select} -
%w{hidden_field label fields_for}
helpers.each do |name|
define_method(name) do |field, *args|
options_index = ActionView::Helpers::FormBuilder.instance_method(name.to_sym).parameters.index([:opt,:options])
if options_index.nil?
options = args.last.is_a?(Hash) ? args.pop : {}
else
options = args[options_index - 1]
end
label = label(field, options[:label], :class => options[:label_class])
@template.content_tag(:div, :class => 'clearfix') do
@template.concat(label)
@template.concat(@template.content_tag(:div, :class => 'input') { @template.concat(super(field, *args)) })
end
end
end
end
ActionView::Base.default_form_builder = BootstrapFormBuilder
Personally I don't like the asset files having the version included. This kind of defeats the purpose of using a gem in the first place over manually vendoring the files if you still need to modify your application.css. My suggestion would be to version the gem the same as the bootstrap framework, and if you desire use bundler to lock the version.
I think the installed app/assets/javascripts/bootstrap.js.coffee ends up mostly doing nothing if you follow bootstrap's documentation when setting up the widgets.
For example:
$ ->
$(".alert").alert()
Is roughly duplicate functionality of this chunk in /assets/twitter/bootstrap/bootstrap-alert.js:
$(function () {
$('body').on('click.alert.data-api', dismiss, Alert.prototype.close)
})
and:
$ ->
$(".dropdown-toggle").dropdown()
is roughly duplicate functionality of this chunk in /assets/twitter/bootstrap/bootstrap-dropdown.js:
$(function () {
$('html').on('click.dropdown.data-api', clearMenus)
$('body').on('click.dropdown.data-api', toggle, Dropdown.prototype.toggle)
})
Hi there,
README file sais that gem less
and gem less-rails
should be added in order to use LESS with twitter-bootstrap-rails.
After installing twitter-bootstrap-rails without adding less and less-rails to the Gemfile, those gems are installed after bundle install
, so I guess there is no need to add it to Gemfile because they are dependencies of twitter-boostrap-rails.
Should the README file be updated to reflect this? Or there is a real necessity on referencing explicitly this gems on the Gemfile?
I'm following instruction in README and I got error
V8::JSError
(in /usr/lib/ruby/gems/1.8/gems/twitter-bootstrap-rails-1.4.3/vendor/assets/stylesheets/twitter/bootstrap.css.less)
Rails 3.2.0.rc2
When learning LESS I wanted to do two things.
Item is solved by this gem, but not number too using this syntax
@import "bootstrap";
#foo {
.border-radius(4px);
}
So after reading this issue (http://github.com/cowboyd/less.rb/issues/8) on the less.rb project, I decided to make the Less::Rails gem (http://github.com/metaskills/less-rails). Hopefully soon I can publish this gem to the abandoned rubygems.org/gems/less-rails space.
I am proposing that your railtie hook into this new standard config.less.load_paths so others can avoid using the hack described on my read me.
Looking at lib/generators/bootstrap/themed/builders/builder.rb
it looks like you create a label for every form helper automatically and you also set the default form builder to be BootstrapForm builder.
Either this should be removed so that you are able to use forms in your application or the application helper bootstrap_form_for should be removed.
The _form.html.erb scaffold should also not include a label element in either case.
I'm running rails 3.2 if that helps.
bin/rails g bootstrap:layout application fixed
[WARNING] Could not load generator "generators/bootstrap/layout/layout_generator". Error: uninitialized constant Bootstrap::Rails::Generators.
Trying to use the new icons in bootstrap 2.0
<i class="icon envelope"></i>
Icon doesn't show up. Net inspector shows 404 when browser calls:
http://localhost:3000/assets/twitter/docs/assets/img/glyphicons-halflings-sprite.png
Hi, there are problem with generating fluid and fixed layouts
$ rails g bootstrap:layout application fluid
/Users/alec/.rvm/gems/ruby-1.9.3-p0/bundler/gems/twitter-bootstrap-rails-61315ee040a8/lib/generators/bootstrap/layout/layout_generator.rb:15:in add_helper': undefined method
root' for Bootstrap::Rails:Module (NoMethodError)
from /Users/alec/.rvm/gems/ruby-1.9.3-p0/gems/thor-0.14.6/lib/thor/task.rb:22:in run' from /Users/alec/.rvm/gems/ruby-1.9.3-p0/gems/thor-0.14.6/lib/thor/invocation.rb:118:in
invoke_task'
from /Users/alec/.rvm/gems/ruby-1.9.3-p0/gems/thor-0.14.6/lib/thor/invocation.rb:124:in block in invoke_all' from /Users/alec/.rvm/gems/ruby-1.9.3-p0/gems/thor-0.14.6/lib/thor/invocation.rb:124:in
each'
from /Users/alec/.rvm/gems/ruby-1.9.3-p0/gems/thor-0.14.6/lib/thor/invocation.rb:124:in map' from /Users/alec/.rvm/gems/ruby-1.9.3-p0/gems/thor-0.14.6/lib/thor/invocation.rb:124:in
invoke_all'
from /Users/alec/.rvm/gems/ruby-1.9.3-p0/gems/thor-0.14.6/lib/thor/group.rb:226:in dispatch' from /Users/alec/.rvm/gems/ruby-1.9.3-p0/gems/thor-0.14.6/lib/thor/base.rb:389:in
start'
from /Users/alec/.rvm/gems/ruby-1.9.3-p0/gems/railties-3.2.1/lib/rails/generators.rb:170:in invoke' from /Users/alec/.rvm/gems/ruby-1.9.3-p0/gems/railties-3.2.1/lib/rails/commands/generate.rb:12:in
<top (required)>'
from /Users/alec/.rvm/gems/ruby-1.9.3-p0/gems/activesupport-3.2.1/lib/active_support/dependencies.rb:251:in require' from /Users/alec/.rvm/gems/ruby-1.9.3-p0/gems/activesupport-3.2.1/lib/active_support/dependencies.rb:251:in
block in require'
from /Users/alec/.rvm/gems/ruby-1.9.3-p0/gems/activesupport-3.2.1/lib/active_support/dependencies.rb:236:in load_dependency' from /Users/alec/.rvm/gems/ruby-1.9.3-p0/gems/activesupport-3.2.1/lib/active_support/dependencies.rb:251:in
require'
from /Users/alec/.rvm/gems/ruby-1.9.3-p0/gems/railties-3.2.1/lib/rails/commands.rb:29:in `<top (required)>'
Getting the follow error:
$ gem install twitter-bootstrap-rails
ERROR: While executing gem ... (Gem::DependencyError)
Unable to resolve dependencies: railties requires activesupport (= 3.2.0.rc1), actionpack (= 3.2.0.rc1)
It looks like the 'railties' dependency doesn't have a version number in twitter-bootstrap-rails.gemspec. Maybe this is it?
Thanks for the great gem!
Currently this project cannot be installed into JRuby due to {{less}}, which depends on {{therubyracer}} which cannot install into JRuby.
Is there an alternate dependency that supports JRuby?
Alternately, perhaps document that JRuby isn't supported?
Thanks!
I am using rails 3.2.1 and I am seeing this error when I try to run rails g bootstrap:install
> rails g bootstrap:install
[WARNING] Could not load generator "generators/bootstrap/install/install_generator". Error: uninitialized constant Bootstrap::Rails::Generators.
/home/sean/.rvm/gems/ruby-1.9.3-p0@closelocal/bundler/gems/twitter-bootstrap-rails-02bdece177eb/lib/generators/bootstrap/install/install_generator.rb:5:in `<module:Generators>'
/home/sean/.rvm/gems/ruby-1.9.3-p0@closelocal/bundler/gems/twitter-bootstrap-rails-02bdece177eb/lib/generators/bootstrap/install/install_generator.rb:4:in `<module:Bootstrap>'
/home/sean/.rvm/gems/ruby-1.9.3-p0@closelocal/bundler/gems/twitter-bootstrap-rails-02bdece177eb/lib/generators/bootstrap/install/install_generator.rb:3:in `<top (required)>'
/home/sean/.rvm/gems/ruby-1.9.3-p0@closelocal/gems/railties-3.2.1/lib/rails/generators.rb:298:in `block (2 levels) in lookup'
/home/sean/.rvm/gems/ruby-1.9.3-p0@closelocal/gems/railties-3.2.1/lib/rails/generators.rb:294:in `each'
/home/sean/.rvm/gems/ruby-1.9.3-p0@closelocal/gems/railties-3.2.1/lib/rails/generators.rb:294:in `block in lookup'
/home/sean/.rvm/gems/ruby-1.9.3-p0@closelocal/gems/railties-3.2.1/lib/rails/generators.rb:293:in `each'
/home/sean/.rvm/gems/ruby-1.9.3-p0@closelocal/gems/railties-3.2.1/lib/rails/generators.rb:293:in `lookup'
/home/sean/.rvm/gems/ruby-1.9.3-p0@closelocal/gems/railties-3.2.1/lib/rails/generators.rb:151:in `find_by_namespace'
/home/sean/.rvm/gems/ruby-1.9.3-p0@closelocal/gems/railties-3.2.1/lib/rails/generators.rb:168:in `invoke'
/home/sean/.rvm/gems/ruby-1.9.3-p0@closelocal/gems/railties-3.2.1/lib/rails/commands/generate.rb:12:in `<top (required)>'
/home/sean/.rvm/gems/ruby-1.9.3-p0@closelocal/gems/railties-3.2.1/lib/rails/commands.rb:29:in `<top (required)>'
script/rails:6:in `require'
script/rails:6:in `<main>'
Could not find generator bootstrap:install.
I saw a previous error that was very similar, but that bug had been closed due to rails 3.2 support.
In the generated less file, we are importing twitter/bootstrap and twitter/bootstrap/responsive both brings in variables and mixins modules. That results in element attribute styling repetitions like so:
a:focus {
outline: thin dotted;
outline: 5px auto -webkit-focus-ring-color;
outline-offset: -2px;
outline: thin dotted;
outline: 5px auto -webkit-focus-ring-color;
outline-offset: -2px;
}
I saw that this was pattern similarly to web_app_theme and was wondering it fully supported mongoid, because the
columns method in themed_generator.rb, suggest there is support for it but template files like templates / show.html.erb, makes me feel unsure, so i said i should clarify here for myself and for others since it isn't mentioned in the documentation.
I couldn't get this gem to generate HAML Views and work with a HAML Layout. Is this available in some form?
When I run rails g bootstrap:install I get the following error:
Rails 3.1.3
Ruby 1.9.3
ruby-1.9.3-p0 > rails g bootstrap:install
/Users/ryanresella/.rvm/gems/ruby-1.9.3-p0/gems/twitter-bootstrap-rails-1.4.1/lib/generators/bootstrap/install/install_generator.rb:5:in <module:Generators>': uninitialized constant Bootstrap::Rails::Generators (NameError) from /Users/ryanresella/.rvm/gems/ruby-1.9.3-p0/gems/twitter-bootstrap-rails-1.4.1/lib/generators/bootstrap/install/install_generator.rb:4:in
module:Bootstrap'
from /Users/ryanresella/.rvm/gems/ruby-1.9.3-p0/gems/twitter-bootstrap-rails-1.4.1/lib/generators/bootstrap/install/install_generator.rb:3:in <top (required)>' from /Users/ryanresella/.rvm/gems/ruby-1.9.3-p0/gems/railties-3.1.3/lib/rails/generators.rb:297:in
block (2 levels) in lookup'
from /Users/ryanresella/.rvm/gems/ruby-1.9.3-p0/gems/railties-3.1.3/lib/rails/generators.rb:293:in each' from /Users/ryanresella/.rvm/gems/ruby-1.9.3-p0/gems/railties-3.1.3/lib/rails/generators.rb:293:in
block in lookup'
from /Users/ryanresella/.rvm/gems/ruby-1.9.3-p0/gems/railties-3.1.3/lib/rails/generators.rb:292:in each' from /Users/ryanresella/.rvm/gems/ruby-1.9.3-p0/gems/railties-3.1.3/lib/rails/generators.rb:292:in
lookup'
from /Users/ryanresella/.rvm/gems/ruby-1.9.3-p0/gems/railties-3.1.3/lib/rails/generators.rb:149:in find_by_namespace' from /Users/ryanresella/.rvm/gems/ruby-1.9.3-p0/gems/railties-3.1.3/lib/rails/generators.rb:166:in
invoke'
from /Users/ryanresella/.rvm/gems/ruby-1.9.3-p0/gems/railties-3.1.3/lib/rails/commands/generate.rb:12:in <top (required)>' from /Users/ryanresella/.rvm/gems/ruby-1.9.3-p0/gems/railties-3.1.3/lib/rails/commands.rb:28:in
<top (required)>'
from script/rails:6:in require' from script/rails:6:in
so in modals the forms and buttons don't show up, not sure why this is so different from the actual bootstrap css
The names of CSS classes were changed in the 2.0 version of Bootstrap. Please update the generators accordingly, as of now everything looks screwed.
I just installed the gem and I can't find the Twitter Bootstrap files anywhere in my application folder. Should they be in the /vendor/ folder?
I tried both the 'normal' way and with specifying the github repo.
Any ideas? thanks
In bootstrap 2 the topbar has been changed to the navbar, the generator is still using the old topbar class.
I'm having problems getting therubyracer to install, which of course is a problem with therubyracer or my machine, but I'm wondering why it's a necessary dependency? It wasn't previously. Also, I notice you truncated the commit history or something, so I can't pin to a previous version :(
Bootstrap 2.0 says that the new grid is 12 columns, but in practice I'm finding that this gem is still supporting the 16 column grid from the older version. Curious what's up with that - intentional?
Everything is working just fine, but I'm not able to use variables and mixins.
I posted my code from bootstrap.css.less into a Gist, if you want to have a look at it.
https://gist.github.com/1392164
Thanks...
Hi.
I'm trying to override variables described here http://twitter.github.com/bootstrap/less.html#variables
I'm ok with overriding basefont and baseline but it doesn't work with some others (e.g. navbarBackground).
Thanks, Vlad.
I am trying to include the responsive module in my application.css - how would I accomplish this?
http://twitter.github.com/bootstrap/scaffolding.html#responsive
Thanks,
Doug
I wrote a bootstrap_form_for builder that outputs HTML for use with Bootstrap 2.0's .form-horizontal or .form-vertical styles.
https://gist.github.com/1695087
It follows Bootstrap's convention of adding the .error class to the .control-group fieldset and overrides Rail's default error wrapping behavior. It does not conflict with ActionView::Base.field_error_proc so non-bootstrap forms function normally.
This gem seems like a good home for a bootstrap form builder so I thought I would share what I have if you wish to use it as a starting point. It obviously is very basic and needs refinement but it gets the job done.
<%= bootstrap_form_for @user, html: {class: 'form-horizontal'} do |f| %>
<legend>Create an Account</legend>
<%= f.control_group :email do %>
<%= f.email_field :email %>
<% end %>
<%= f.control_group :password do %>
<%= f.text_field :password %>
<p class="help-block">Must be at least 6 characters</p>
<% end %>
<%= f.control_group :full_name do %>
<%= f.text_field :full_name %>
<% end %>
<%= field_set_tag nil, class: 'form-actions' do %>
<%= button_tag 'Create account', type: 'submit', class: 'btn primary' %>
<%= link_to 'Cancel', root_path %>
<% end %>
<% end %>
Chaging their values in bootstrap.css.less doesn't affect what's on-screen. Note that @navbarBackground/@navbarBackgroundHighlight both work in install. 2.0.1
Not sure if it would cause a problem elsewhere (e.g., where assets are precompiled?), but to make the Gem work on Heroku, you have to load it outside of the :assets group.
Otherwise, it gives the error:
ActionView::Template::Error (couldn't find file 'twitter/bootstrap'
Got this error when the end of my app/assets/application.js looked like this (as suggested in the readme)
//= require bootstrap-alerts-1.3.0
//= require bootstrap-dropdown-1.3.0
//= require bootstrap-modal-1.3.0
//= require bootstrap-popover-1.3.0
//= require bootstrap-scrollspy-1.3.0
//= require bootstrap-tabs-1.3.0
//= require bootstrap-twipsy-1.3.0
Moving the twipsy line to before the popover line solved this problem (popover depends on twipsy)
//= require bootstrap-alerts-1.3.0
//= require bootstrap-dropdown-1.3.0
//= require bootstrap-modal-1.3.0
//= require bootstrap-twipsy-1.3.0
//= require bootstrap-popover-1.3.0
//= require bootstrap-scrollspy-1.3.0
//= require bootstrap-tabs-1.3.0
Just updated my bundle to have bootstrap 2.0 and now i got an error when running "rake assets:precompile":
rake aborted!
Cannot call method 'charAt' of undefined
(in /home/codular/.rvm/gems/ruby-1.9.3-p0/bundler/gems/twitter-bootstrap-rails-bda879201e63/vendor/assets/stylesheets/twitter/bootstrap.css.less)
Tasks: TOP => assets:precompile
Any ideas to resolve it ?
The code (lines 20-23), which should add a new menu entry to
Since it only supports ERB, I wonder, whether it would be better to take it out at all.
Regards Thomas
insert app/assets/javascripts/application.js
insert app/assets/stylesheets/application.css
/Users/aaron/Sites/jobschneider/app/vendor/bundle/ruby/1.9.1/gems/thor-0.14.6/lib/thor/actions/inject_into_file.rb:99:in `binread': No such file or directory - /Users/aaron/Sites/jobschneider/app/app/assets/stylesheets/application.css (Errno::ENOENT)
from /Users/aaron/Sites/jobschneider/app/vendor/bundle/ruby/1.9.1/gems/thor-0.14.6/lib/thor/actions/inject_into_file.rb:99:in `replace!'
from /Users/aaron/Sites/jobschneider/app/vendor/bundle/ruby/1.9.1/gems/thor-0.14.6/lib/thor/actions/inject_into_file.rb:60:in `invoke!'
from /Users/aaron/Sites/jobschneider/app/vendor/bundle/ruby/1.9.1/gems/thor-0.14.6/lib/thor/actions.rb:95:in `action'
from /Users/aaron/Sites/jobschneider/app/vendor/bundle/ruby/1.9.1/gems/thor-0.14.6/lib/thor/actions/inject_into_file.rb:31:in `insert_into_file'
from /Users/aaron/Sites/jobschneider/app/vendor/bundle/ruby/1.9.1/bundler/gems/twitter-bootstrap-rails-4296bb9105ca/lib/generators/bootstrap/install/install_generator.rb:11:in `add_assets'
from /Users/aaron/Sites/jobschneider/app/vendor/bundle/ruby/1.9.1/gems/thor-0.14.6/lib/thor/task.rb:22:in `run'
from /Users/aaron/Sites/jobschneider/app/vendor/bundle/ruby/1.9.1/gems/thor-0.14.6/lib/thor/invocation.rb:118:in `invoke_task'
from /Users/aaron/Sites/jobschneider/app/vendor/bundle/ruby/1.9.1/gems/thor-0.14.6/lib/thor/invocation.rb:124:in `block in invoke_all'
from /Users/aaron/Sites/jobschneider/app/vendor/bundle/ruby/1.9.1/gems/thor-0.14.6/lib/thor/invocation.rb:124:in `each'
from /Users/aaron/Sites/jobschneider/app/vendor/bundle/ruby/1.9.1/gems/thor-0.14.6/lib/thor/invocation.rb:124:in `map'
from /Users/aaron/Sites/jobschneider/app/vendor/bundle/ruby/1.9.1/gems/thor-0.14.6/lib/thor/invocation.rb:124:in `invoke_all'
from /Users/aaron/Sites/jobschneider/app/vendor/bundle/ruby/1.9.1/gems/thor-0.14.6/lib/thor/group.rb:226:in `dispatch'
from /Users/aaron/Sites/jobschneider/app/vendor/bundle/ruby/1.9.1/gems/thor-0.14.6/lib/thor/base.rb:389:in `start'
from /Users/aaron/Sites/jobschneider/app/vendor/bundle/ruby/1.9.1/gems/railties-3.1.1/lib/rails/generators.rb:168:in `invoke'
from /Users/aaron/Sites/jobschneider/app/vendor/bundle/ruby/1.9.1/gems/railties-3.1.1/lib/rails/commands/generate.rb:12:in `<top (required)>'
from /Users/aaron/Sites/jobschneider/app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:240:in `require'
from /Users/aaron/Sites/jobschneider/app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:240:in `block in require'
from /Users/aaron/Sites/jobschneider/app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:223:in `block in load_dependency'
from /Users/aaron/Sites/jobschneider/app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:640:in `new_constants_in'
from /Users/aaron/Sites/jobschneider/app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:223:in `load_dependency'
from /Users/aaron/Sites/jobschneider/app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:240:in `require'
from /Users/aaron/Sites/jobschneider/app/vendor/bundle/ruby/1.9.1/gems/railties-3.1.1/lib/rails/commands.rb:28:in `<top (required)>'
from script/rails:6:in `require'
I added a blank application.css to app/assets/stylesheets
and it generated everything without errors
Hi,
can you let me know how different is this by adding the css and JS files from Bootstrap itself??
Thx
Just announced: https://dev.twitter.com/blog/say-hello-to-bootstrap-2
I'm trying to generate a fluid layout
rails g bootstrap:layout admin fluid
I get this error:
(erb):71:in template': undefined local variable or method
flash' for #Bootstrap::Generators::LayoutGenerator:0x007f9e65c9bb38 (NameError)
There's some invalid CSS in the LESS files that you are using. This is causing Heroku asset precompiling to fail.
They have been fixed in the latest trunk over at twitter-bootstrap 2.0
Particularly, this one:
twbs/bootstrap@9b9e1d3
[WARNING] Could not load generator "generators/bootstrap/install/install_generator". Error: uninitialized constant Bootstrap::Rails::Generators.
/Users/user/.rvm/gems/ruby-1.9.2-p180/bundler/gems/twitter-bootstrap-rails-b747bae72b55/lib/generators/bootstrap/install/install_generator.rb:5:in `module:Generators'
Perhaps an issue with your gem build, not sure as your gem spec looks fine. But this is what I see after installing the gem. In the meantime, I will bundle up to the repo.
∴ tree /Users/kencollins/Repositories/homemarks_app/vendor/ruby/1.9.1/gems/twitter-bootstrap-rails-0.0.4
/Users/kencollins/Repositories/homemarks_app/vendor/ruby/1.9.1/gems/twitter-bootstrap-rails-0.0.4
├── Gemfile
├── Rakefile
├── lib
│ ├── twitter-bootstrap-rails
│ │ └── version.rb
│ └── twitter-bootstrap-rails.rb
└── twitter-bootstrap-rails.gemspec
Hey guys,
I run rails g bootstrap:install
added *= require twitter/bootstrap to application.css and get this error
'reset.css.less' wasn't found.
(in project/vendor/assets/stylesheets/twitter/bootstrap.css.less)
I am using master branch version and i am trying to override some less variables in the bootstrap.css.less but it is not working.
@import "twitter/bootstrap";
// Baseline grid
@basefont: 20px;
@baseline: 18px;
@gridColumns: 24;
@gridGutterWidth: 20px;
@gridColumnWidth: 21px;
@primaryButtonBackground: white;
Twitter Bootstrap 2 will be out sooner than later ( http://www.markdotto.com/2012/01/24/bootstrap-2-ready-for-testing-and-feedback/ )
Any chance this plugin can support it (either via a branch, or bundle both and a config directive specifies which to serve..) ?
Hi,
I dont understand use of this gem? are you overriding the form helpers like text_field_tag etc?? It seems you are not.. You are giving me the only assets with this project? correct me if I am wrong..
Thx
Hi there.
I'm having problems precompiling my assets with twitter-bootstrap-rails.
Russetl pml$ rake assets:precompile
/Users/pml/.rvm/rubies/ruby-1.9.2-p136/bin/ruby /Users/pml/.rvm/gems/ruby-1.9.2-p136/bin/rake assets:precompile:all RAILS_ENV=production RAILS_GROUPS=assets
rake aborted!
file 'reset.less' wasn't found.
(in /Users/pml/.rvm/gems/ruby-1.9.2-p136/bundler/gems/twitter-bootstrap-rails-8d2ffc94bd64/vendor/assets/stylesheets/bootstrap/bootstrap.less)
Tasks: TOP => assets:precompile:primary
Has anyone encountered this before, and is there a workaround? I will try to investigate it in more detail, but I'm really strapped for time at the moment :/
Paul
I've followed your instructions, it seems that it works, but when I try to create a new resource (action "new"), I've got this error
undefined method `parameters' for #UnboundMethod: ActionView::Helpers::FormBuilder#text_field
This is the line where something doesn't works properly
f.text_field :name, :class => :text_field
I'm using rails 3.1.1and your gem from this repo
originally opened it against slim, https://github.com/stonean/slim/issues/211
using twitter-bootstrap-rails 1.4.1 and rails 3.1.1 issue was caused by the last 2 lines in auto-generated app/assets/javascripts/bootstrap.js.coffee
$ ->
$(".btn").button "complete"
should be easy to reproduce. create new rails app and add twitter-bootstrap-rails to Gemfile (bundle install etc.). run rails g bootstrap:install
and create a basic view with
Foo
in my case the button is not disabled. let me know if more info is needed.
bootstrap.less
mixins.less
reset.less
tables.less
variables.less
forms.less
patterns.less
scaffolding.less
type.less
there is no navbar.less that I need in twitter-bootstrap-rails-1.4.3/vendor/toolkit/twitter/bootstrap
gemfile
gem 'pg'
gem 'twitter-bootstrap-rails'
gem 'devise'
group :assets do
gem 'sass-rails', " > 3.1.0"> 3.1.0"
gem 'coffee-rails', "
gem 'uglifier'
end
ran bundle install
running rails g generates an error
gems/twitter-bootstrap-rails-0.0.4/lib/twitter-bootstrap-rails.rb:7:in `require': no such file to load -- twitter-bootstrap-rails/engine (LoadError)
The icon path in css is ../img/glyphicons-halflings.png
, but it's not exist.
It should be http://lvh.me:3000/assets/glyphicons-halflings.png
Using rails 3.2.0.rc1 twitter-bootstrap-rails installation returns the following error:
Bundler could not find compatible versions for gem "jquery-rails":
In Gemfile:
twitter-bootstrap-rails (>= 0) ruby depends on
jquery-rails (~> 1.0) ruby
jquery-rails (2.0.0)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.